| 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. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 58 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoRenderFrame); | 57 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoRenderFrame); |
| 59 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSetSize); | 58 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSetSize); |
| 60 | 59 |
| 61 enum DecoderState { | 60 enum DecoderState { |
| 62 kUnInitialized, | 61 kUnInitialized, |
| 63 kNormal, | 62 kNormal, |
| 64 kPaused, | 63 kPaused, |
| 65 kStopped | 64 kStopped |
| 66 }; | 65 }; |
| 67 | 66 |
| 67 virtual ~RTCVideoDecoder(); |
| 68 |
| 68 MessageLoop* message_loop_; | 69 MessageLoop* message_loop_; |
| 69 gfx::Size visible_size_; | 70 gfx::Size visible_size_; |
| 70 std::string url_; | 71 std::string url_; |
| 71 DecoderState state_; | 72 DecoderState state_; |
| 72 ReadCB read_cb_; | 73 ReadCB read_cb_; |
| 73 bool got_first_frame_; | 74 bool got_first_frame_; |
| 74 base::TimeDelta last_frame_timestamp_; | 75 base::TimeDelta last_frame_timestamp_; |
| 75 base::TimeDelta start_time_; | 76 base::TimeDelta start_time_; |
| 76 | 77 |
| 77 // Used for accessing |read_cb_| from another thread. | 78 // Used for accessing |read_cb_| from another thread. |
| 78 base::Lock lock_; | 79 base::Lock lock_; |
| 79 | 80 |
| 80 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); | 81 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 84 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| OLD | NEW |