blob: bef8e699a5e1fb56ba6533df776e1beaab330061 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/player/wtl_renderer.h"
#include "media/player/view.h"
WtlVideoRenderer::WtlVideoRenderer(WtlVideoWindow* window)
: window_(window) {
}
WtlVideoRenderer::~WtlVideoRenderer() {
}
// static
bool WtlVideoRenderer::IsMediaFormatSupported(
const media::MediaFormat& media_format) {
int width = 0;
int height = 0;
return ParseMediaFormat(media_format, &width, &height);
}
void WtlVideoRenderer::OnStop() {
}
bool WtlVideoRenderer::OnInitialize(media::VideoDecoder* decoder) {
int width = 0;
int height = 0;
if (!ParseMediaFormat(decoder->media_format(), &width, &height))
return false;
window_->SetSize(width, height);
return true;
}
void WtlVideoRenderer::OnFrameAvailable() {
window_->Invalidate();
}
|