Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: talk/app/webrtc/mediastreaminterface.h

Issue 1594973006: New rtc::VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Workaround to not break chrome. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/rtpsenderreceiver_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 22 matching lines...) Expand all
33 33
34 #ifndef TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ 34 #ifndef TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_
35 #define TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ 35 #define TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_
36 36
37 #include <string> 37 #include <string>
38 #include <vector> 38 #include <vector>
39 39
40 #include "webrtc/base/basictypes.h" 40 #include "webrtc/base/basictypes.h"
41 #include "webrtc/base/refcount.h" 41 #include "webrtc/base/refcount.h"
42 #include "webrtc/base/scoped_ref_ptr.h" 42 #include "webrtc/base/scoped_ref_ptr.h"
43 #include "webrtc/media/base/videosinkinterface.h"
43 44
44 namespace cricket { 45 namespace cricket {
45 46
46 class AudioRenderer; 47 class AudioRenderer;
47 class VideoCapturer; 48 class VideoCapturer;
48 class VideoRenderer; 49 class VideoRenderer;
49 class VideoFrame; 50 class VideoFrame;
50 51
51 } // namespace cricket 52 } // namespace cricket
52 53
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 virtual TrackState state() const = 0; 110 virtual TrackState state() const = 0;
110 virtual bool set_enabled(bool enable) = 0; 111 virtual bool set_enabled(bool enable) = 0;
111 // These methods should be called by implementation only. 112 // These methods should be called by implementation only.
112 virtual bool set_state(TrackState new_state) = 0; 113 virtual bool set_state(TrackState new_state) = 0;
113 114
114 protected: 115 protected:
115 virtual ~MediaStreamTrackInterface() {} 116 virtual ~MediaStreamTrackInterface() {}
116 }; 117 };
117 118
118 // Interface for rendering VideoFrames from a VideoTrack 119 // Interface for rendering VideoFrames from a VideoTrack
119 class VideoRendererInterface { 120 class VideoRendererInterface
121 : public rtc::VideoSinkInterface<cricket::VideoFrame> {
120 public: 122 public:
121 // |frame| may have pending rotation. For clients which can't apply rotation, 123 // |frame| may have pending rotation. For clients which can't apply rotation,
122 // |frame|->GetCopyWithRotationApplied() will return a frame that has the 124 // |frame|->GetCopyWithRotationApplied() will return a frame that has the
123 // rotation applied. 125 // rotation applied.
124 virtual void RenderFrame(const cricket::VideoFrame* frame) = 0; 126 virtual void RenderFrame(const cricket::VideoFrame* frame) = 0;
127 // Intended to replace RenderFrame.
128 void OnFrame(const cricket::VideoFrame& frame) override {
129 RenderFrame(&frame);
130 }
125 131
126 protected: 132 protected:
127 // The destructor is protected to prevent deletion via the interface. 133 // The destructor is protected to prevent deletion via the interface.
128 // This is so that we allow reference counted classes, where the destructor 134 // This is so that we allow reference counted classes, where the destructor
129 // should never be public, to implement the interface. 135 // should never be public, to implement the interface.
130 virtual ~VideoRendererInterface() {} 136 virtual ~VideoRendererInterface() {}
131 }; 137 };
132 138
133 class VideoSourceInterface; 139 class VideoSourceInterface;
134 140
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; 273 virtual bool RemoveTrack(AudioTrackInterface* track) = 0;
268 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; 274 virtual bool RemoveTrack(VideoTrackInterface* track) = 0;
269 275
270 protected: 276 protected:
271 virtual ~MediaStreamInterface() {} 277 virtual ~MediaStreamInterface() {}
272 }; 278 };
273 279
274 } // namespace webrtc 280 } // namespace webrtc
275 281
276 #endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ 282 #endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/rtpsenderreceiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698