Make VideoTrack and VideoTrackRenderers implement rtc::VideoSourceInterface.

This patch tries to only change the interface to VideoTrack, with
minimal changes to the implementation. Some points worth noting:

VideoTrackRenderers should ultimately be deleted, but it is kept for
now since we need an object implementing webrtc::VideoRenderer, and
that shouldn't be VideoTrack.

BUG=webrtc:5426
TBR=glaznev@webrtc.org  // please look at  examples

Review URL: https://codereview.webrtc.org/1684423002

Cr-Commit-Position: refs/heads/master@{#11775}
This commit is contained in:
nisse
2016-02-26 01:24:58 -08:00
committed by Commit bot
parent fc59c4425e
commit db25d2e8c5
10 changed files with 148 additions and 52 deletions

View File

@ -71,7 +71,7 @@ class GtkMainWnd : public MainWindow {
void OnRedraw();
protected:
class VideoRenderer : public webrtc::VideoRendererInterface {
class VideoRenderer : public rtc::VideoSinkInterface<cricket::VideoFrame> {
public:
VideoRenderer(GtkMainWnd* main_wnd,
webrtc::VideoTrackInterface* track_to_render);
@ -79,7 +79,7 @@ class GtkMainWnd : public MainWindow {
// VideoRendererInterface implementation
virtual void SetSize(int width, int height);
virtual void RenderFrame(const cricket::VideoFrame* frame);
virtual void OnFrame(const cricket::VideoFrame& frame);
const uint8_t* image() const { return image_.get(); }