Chromium Code Reviews| Index: content/renderer/media/rtc_video_decoder.h |
| =================================================================== |
| --- content/renderer/media/rtc_video_decoder.h (revision 89290) |
| +++ content/renderer/media/rtc_video_decoder.h (working copy) |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef MEDIA_FILTERS_RTC_VIDEO_DECODER_H_ |
| -#define MEDIA_FILTERS_RTC_VIDEO_DECODER_H_ |
| +#ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| +#define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| #include <deque> |
| #include <string> |
| @@ -13,59 +13,39 @@ |
| #include "media/base/filters.h" |
| #include "media/base/video_frame.h" |
| #include "media/filters/decoder_base.h" |
| +#include "third_party/libjingle/source/talk/session/phone/mediachannel.h" |
|
scherkus (not reviewing)
2011/06/27 23:06:08
woah!?
why are we now implementing cricket::Video
|
| -// TODO(ronghuawu) ExternalRenderer should be defined in WebRtc |
| -class ExternalRenderer { |
| +class RTCVideoDecoder |
| + : public media::VideoDecoder, |
| + public cricket::VideoRenderer { |
| public: |
| - virtual int FrameSizeChange(unsigned int width, |
| - unsigned int height, |
| - unsigned int number_of_streams) = 0; |
| - virtual int DeliverFrame(unsigned char* buffer, int buffer_size) = 0; |
| - |
| - protected: |
| - virtual ~ExternalRenderer() {} |
| -}; |
| - |
| -namespace media { |
| - |
| -class RTCVideoDecoder : public VideoDecoder, |
| - public ExternalRenderer { |
| - public: |
| RTCVideoDecoder(MessageLoop* message_loop, const std::string& url); |
| virtual ~RTCVideoDecoder(); |
| // Filter implementation. |
| - virtual void Play(FilterCallback* callback); |
| - virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb); |
| - virtual void Pause(FilterCallback* callback); |
| - virtual void Stop(FilterCallback* callback); |
| + virtual void Play(media::FilterCallback* callback); |
| + virtual void Seek(base::TimeDelta time, const media::FilterStatusCB& cb); |
| + virtual void Pause(media::FilterCallback* callback); |
| + virtual void Stop(media::FilterCallback* callback); |
| // Decoder implementation. |
| - virtual void Initialize(DemuxerStream* demuxer_stream, |
| - FilterCallback* filter_callback, |
| - StatisticsCallback* stat_callback); |
| - virtual const MediaFormat& media_format(); |
| - virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> video_frame); |
| + virtual void Initialize(media::DemuxerStream* demuxer_stream, |
| + media::FilterCallback* filter_callback, |
| + media::StatisticsCallback* stat_callback); |
| + virtual const media::MediaFormat& media_format(); |
| + virtual void ProduceVideoFrame(scoped_refptr<media::VideoFrame> video_frame); |
| virtual bool ProvidesBuffer(); |
| - // ExternalRenderer implementation |
| - virtual int FrameSizeChange(unsigned int width, |
| - unsigned int height, |
| - unsigned int number_of_streams); |
| + // cricket::VideoRenderer implementation |
| + virtual bool SetSize(int width, int height, int reserved); |
| + virtual bool RenderFrame(const cricket::VideoFrame *frame); |
| - virtual int DeliverFrame(unsigned char* buffer, |
| - int buffer_size); |
| - |
| - // TODO(ronghuawu): maybe move this function to a |
| - // base class (RawVideoDecoder) so that the camera preview may share this. |
| - static bool IsUrlSupported(const std::string& url); |
| - |
| private: |
| friend class RTCVideoDecoderTest; |
| FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, Initialize_Successful); |
| FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSeek); |
| - FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoDeliverFrame); |
| - FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoFrameSizeChange); |
| + FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoRenderFrame); |
| + FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSetSize); |
| enum DecoderState { |
| kUnInitialized, |
| @@ -80,14 +60,13 @@ |
| size_t height_; |
| std::string url_; |
| DecoderState state_; |
| - MediaFormat media_format_; |
| - std::deque<scoped_refptr<VideoFrame> > frame_queue_available_; |
| + media::MediaFormat media_format_; |
| + std::deque<scoped_refptr<media::VideoFrame> > frame_queue_available_; |
| // Used for accessing frame queue from another thread. |
| base::Lock lock_; |
| DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); |
| }; |
| -} // namespace media |
| +#endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| -#endif // MEDIA_FILTERS_RTC_VIDEO_DECODER_H_ |