Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 virtual void Seek(base::TimeDelta time, | 36 virtual void Seek(base::TimeDelta time, |
| 37 const media::FilterStatusCB& cb) OVERRIDE; | 37 const media::FilterStatusCB& cb) OVERRIDE; |
| 38 virtual void Pause(const base::Closure& callback) OVERRIDE; | 38 virtual void Pause(const base::Closure& callback) OVERRIDE; |
| 39 virtual void Stop(const base::Closure& callback) OVERRIDE; | 39 virtual void Stop(const base::Closure& callback) OVERRIDE; |
| 40 | 40 |
| 41 // Decoder implementation. | 41 // Decoder implementation. |
| 42 virtual void Initialize( | 42 virtual void Initialize( |
| 43 media::DemuxerStream* demuxer_stream, | 43 media::DemuxerStream* demuxer_stream, |
| 44 const base::Closure& filter_callback, | 44 const base::Closure& filter_callback, |
| 45 const media::StatisticsCallback& stat_callback) OVERRIDE; | 45 const media::StatisticsCallback& stat_callback) OVERRIDE; |
| 46 virtual void ProduceVideoFrame( | 46 virtual void Read(const ReadCB& callback) OVERRIDE; |
| 47 scoped_refptr<media::VideoFrame> video_frame) OVERRIDE; | |
| 48 virtual gfx::Size natural_size() OVERRIDE; | 47 virtual gfx::Size natural_size() OVERRIDE; |
| 49 | 48 |
| 50 // cricket::VideoRenderer implementation | 49 // cricket::VideoRenderer implementation |
| 51 virtual bool SetSize(int width, int height, int reserved) OVERRIDE; | 50 virtual bool SetSize(int width, int height, int reserved) OVERRIDE; |
| 52 virtual bool RenderFrame(const cricket::VideoFrame* frame) OVERRIDE; | 51 virtual bool RenderFrame(const cricket::VideoFrame* frame) OVERRIDE; |
| 53 | 52 |
| 54 private: | 53 private: |
| 55 friend class RTCVideoDecoderTest; | 54 friend class RTCVideoDecoderTest; |
| 56 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, Initialize_Successful); | 55 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, Initialize_Successful); |
| 57 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSeek); | 56 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSeek); |
| 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 kSeeking, | |
| 65 kPaused, | 63 kPaused, |
| 66 kStopped | 64 kStopped |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 MessageLoop* message_loop_; | 67 MessageLoop* message_loop_; |
| 70 gfx::Size visible_size_; | 68 gfx::Size visible_size_; |
| 71 std::string url_; | 69 std::string url_; |
| 72 DecoderState state_; | 70 DecoderState state_; |
| 73 std::deque<scoped_refptr<media::VideoFrame> > frame_queue_available_; | 71 ReadCB read_cb_; |
| 74 // Used for accessing frame queue from another thread. | 72 |
| 73 // Used for accessing |state_| and |read_cb| from another thread. | |
|
acolwell GONE FROM CHROMIUM
2011/11/03 20:00:43
read_cb_
state_ doesn't appear to be protected by
scherkus (not reviewing)
2011/11/03 20:34:38
Done.
| |
| 75 base::Lock lock_; | 74 base::Lock lock_; |
| 76 | 75 |
| 77 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); | 76 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); |
| 78 }; | 77 }; |
| 79 | 78 |
| 80 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 79 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| OLD | NEW |