| OLD | NEW | 
|---|
| 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  Loading... | 
| 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  Loading... | 
| 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  Loading... | 
| 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_ | 
| OLD | NEW | 
|---|