| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace cricket { | 22 namespace cricket { |
| 23 class VideoFrame; | 23 class VideoFrame; |
| 24 } // namespace cricket | 24 } // namespace cricket |
| 25 | 25 |
| 26 class CONTENT_EXPORT RTCVideoDecoder | 26 class CONTENT_EXPORT RTCVideoDecoder |
| 27 : public media::VideoDecoder, | 27 : public media::VideoDecoder, |
| 28 NON_EXPORTED_BASE(public cricket::VideoRenderer) { | 28 NON_EXPORTED_BASE(public cricket::VideoRenderer) { |
| 29 public: | 29 public: |
| 30 RTCVideoDecoder(MessageLoop* message_loop, const std::string& url); | 30 RTCVideoDecoder(MessageLoop* message_loop, const std::string& url); |
| 31 virtual ~RTCVideoDecoder(); | |
| 32 | 31 |
| 33 // Filter implementation. | 32 // Filter implementation. |
| 34 virtual void Play(const base::Closure& callback) OVERRIDE; | 33 virtual void Play(const base::Closure& callback) OVERRIDE; |
| 35 virtual void Seek(base::TimeDelta time, | 34 virtual void Seek(base::TimeDelta time, |
| 36 const media::PipelineStatusCB& cb) OVERRIDE; | 35 const media::PipelineStatusCB& cb) OVERRIDE; |
| 37 virtual void Pause(const base::Closure& callback) OVERRIDE; | 36 virtual void Pause(const base::Closure& callback) OVERRIDE; |
| 38 virtual void Flush(const base::Closure& callback) OVERRIDE; | 37 virtual void Flush(const base::Closure& callback) OVERRIDE; |
| 39 virtual void Stop(const base::Closure& callback) OVERRIDE; | 38 virtual void Stop(const base::Closure& callback) OVERRIDE; |
| 40 | 39 |
| 41 // Decoder implementation. | 40 // Decoder implementation. |
| 42 virtual void Initialize( | 41 virtual void Initialize( |
| 43 media::DemuxerStream* demuxer_stream, | 42 media::DemuxerStream* demuxer_stream, |
| 44 const media::PipelineStatusCB& status_cb, | 43 const media::PipelineStatusCB& status_cb, |
| 45 const media::StatisticsCB& statistics_cb) OVERRIDE; | 44 const media::StatisticsCB& statistics_cb) OVERRIDE; |
| 46 virtual void Read(const ReadCB& callback) OVERRIDE; | 45 virtual void Read(const ReadCB& callback) OVERRIDE; |
| 47 virtual const gfx::Size& natural_size() OVERRIDE; | 46 virtual const gfx::Size& natural_size() OVERRIDE; |
| 48 | 47 |
| 49 // cricket::VideoRenderer implementation | 48 // cricket::VideoRenderer implementation |
| 50 virtual bool SetSize(int width, int height, int reserved) OVERRIDE; | 49 virtual bool SetSize(int width, int height, int reserved) OVERRIDE; |
| 51 virtual bool RenderFrame(const cricket::VideoFrame* frame) OVERRIDE; | 50 virtual bool RenderFrame(const cricket::VideoFrame* frame) OVERRIDE; |
| 52 | 51 |
| 52 protected: |
| 53 virtual ~RTCVideoDecoder(); |
| 54 |
| 53 private: | 55 private: |
| 54 friend class RTCVideoDecoderTest; | 56 friend class RTCVideoDecoderTest; |
| 55 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, Initialize_Successful); | 57 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, Initialize_Successful); |
| 56 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSeek); | 58 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSeek); |
| 57 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoFlush); | 59 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoFlush); |
| 58 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoRenderFrame); | 60 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoRenderFrame); |
| 59 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSetSize); | 61 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSetSize); |
| 60 | 62 |
| 61 enum DecoderState { | 63 enum DecoderState { |
| 62 kUnInitialized, | 64 kUnInitialized, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 74 base::TimeDelta last_frame_timestamp_; | 76 base::TimeDelta last_frame_timestamp_; |
| 75 base::TimeDelta start_time_; | 77 base::TimeDelta start_time_; |
| 76 | 78 |
| 77 // Used for accessing |read_cb_| from another thread. | 79 // Used for accessing |read_cb_| from another thread. |
| 78 base::Lock lock_; | 80 base::Lock lock_; |
| 79 | 81 |
| 80 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); | 82 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 85 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| OLD | NEW |