| 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 22 matching lines...) Expand all Loading... |
| 33 const media::FilterStatusCB& cb) OVERRIDE; | 33 const media::FilterStatusCB& cb) OVERRIDE; |
| 34 virtual void Pause(media::FilterCallback* callback) OVERRIDE; | 34 virtual void Pause(media::FilterCallback* callback) OVERRIDE; |
| 35 virtual void Stop(media::FilterCallback* callback) OVERRIDE; | 35 virtual void Stop(media::FilterCallback* callback) OVERRIDE; |
| 36 | 36 |
| 37 // Decoder implementation. | 37 // Decoder implementation. |
| 38 virtual void Initialize(media::DemuxerStream* demuxer_stream, | 38 virtual void Initialize(media::DemuxerStream* demuxer_stream, |
| 39 media::FilterCallback* filter_callback, | 39 media::FilterCallback* filter_callback, |
| 40 media::StatisticsCallback* stat_callback) OVERRIDE; | 40 media::StatisticsCallback* stat_callback) OVERRIDE; |
| 41 virtual void ProduceVideoFrame( | 41 virtual void ProduceVideoFrame( |
| 42 scoped_refptr<media::VideoFrame> video_frame) OVERRIDE; | 42 scoped_refptr<media::VideoFrame> video_frame) OVERRIDE; |
| 43 virtual int width() OVERRIDE; | 43 virtual gfx::Size natural_size() OVERRIDE; |
| 44 virtual int height() OVERRIDE; | |
| 45 | 44 |
| 46 // cricket::VideoRenderer implementation | 45 // cricket::VideoRenderer implementation |
| 47 virtual bool SetSize(int width, int height, int reserved) OVERRIDE; | 46 virtual bool SetSize(int width, int height, int reserved) OVERRIDE; |
| 48 virtual bool RenderFrame(const cricket::VideoFrame* frame) OVERRIDE; | 47 virtual bool RenderFrame(const cricket::VideoFrame* frame) OVERRIDE; |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 friend class RTCVideoDecoderTest; | 50 friend class RTCVideoDecoderTest; |
| 52 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, Initialize_Successful); | 51 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, Initialize_Successful); |
| 53 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSeek); | 52 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSeek); |
| 54 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoRenderFrame); | 53 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoRenderFrame); |
| 55 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSetSize); | 54 FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSetSize); |
| 56 | 55 |
| 57 enum DecoderState { | 56 enum DecoderState { |
| 58 kUnInitialized, | 57 kUnInitialized, |
| 59 kNormal, | 58 kNormal, |
| 60 kSeeking, | 59 kSeeking, |
| 61 kPaused, | 60 kPaused, |
| 62 kStopped | 61 kStopped |
| 63 }; | 62 }; |
| 64 | 63 |
| 65 MessageLoop* message_loop_; | 64 MessageLoop* message_loop_; |
| 66 size_t width_; | 65 gfx::Size visible_size_; |
| 67 size_t height_; | |
| 68 std::string url_; | 66 std::string url_; |
| 69 DecoderState state_; | 67 DecoderState state_; |
| 70 std::deque<scoped_refptr<media::VideoFrame> > frame_queue_available_; | 68 std::deque<scoped_refptr<media::VideoFrame> > frame_queue_available_; |
| 71 // Used for accessing frame queue from another thread. | 69 // Used for accessing frame queue from another thread. |
| 72 base::Lock lock_; | 70 base::Lock lock_; |
| 73 | 71 |
| 74 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); | 72 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); |
| 75 }; | 73 }; |
| 76 | 74 |
| 77 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 75 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
| OLD | NEW |