Chromium Code Reviews| Index: media/video/capture/fake_capture_video_decoder.h |
| =================================================================== |
| --- media/video/capture/fake_capture_video_decoder.h (revision 0) |
| +++ media/video/capture/fake_capture_video_decoder.h (revision 0) |
| @@ -0,0 +1,85 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_VIDEO_CAPTURE_FAKE_CAPTURE_VIDEO_DECODER_H_ |
| +#define MEDIA_VIDEO_CAPTURE_FAKE_CAPTURE_VIDEO_DECODER_H_ |
| + |
| +#include "media/base/filters.h" |
| +#include "media/base/pipeline_status.h" |
| +#include "media/video/capture/video_capture.h" |
| + |
| +namespace base { |
| +class MessageLoopProxy; |
| +} |
| + |
| +namespace media { |
| + |
| +class DemuxerStream; |
| +class VideoFrame; |
| + |
| +// A filter generates raw frames and passes them to media engine as a video |
| +// decoder filter. |
| +class MEDIA_EXPORT FakeCaptureVideoDecoder |
| + : public VideoDecoder { |
| + public: |
| + FakeCaptureVideoDecoder( |
| + base::MessageLoopProxy* message_loop_proxy, |
| + const VideoCapture::VideoCaptureCapability& capability); |
| + virtual ~FakeCaptureVideoDecoder(); |
| + |
| + // Filter implementation. |
| + virtual void Seek(base::TimeDelta time, |
| + const FilterStatusCB& cb) OVERRIDE; |
| + virtual void Pause(const base::Closure& callback) OVERRIDE; |
| + virtual void Flush(const base::Closure& callback) OVERRIDE; |
| + virtual void Stop(const base::Closure& callback) OVERRIDE; |
| + |
| + // Decoder implementation. |
| + virtual void Initialize( |
| + DemuxerStream* demuxer_stream, |
| + const PipelineStatusCB& filter_callback, |
| + const StatisticsCallback& stat_callback) OVERRIDE; |
| + virtual void Read(const ReadCB& callback) OVERRIDE; |
| + virtual const gfx::Size& natural_size() OVERRIDE; |
| + |
| + private: |
| + enum DecoderState { |
|
scherkus (not reviewing)
2011/12/21 20:26:45
you can replace all of state with a bool for stopp
wjia(left Chromium)
2012/01/03 17:08:12
Done.
|
| + kUnInitialized, |
| + kNormal, |
| + kStopped, |
| + kPaused |
| + }; |
| + |
| + void SeekOnDecoderThread(base::TimeDelta time, |
| + const FilterStatusCB& cb); |
| + void PauseOnDecoderThread(const base::Closure& callback); |
| + void FlushOnDecoderThread(const base::Closure& callback); |
| + void StopOnDecoderThread(const base::Closure& callback); |
| + |
| + void InitializeOnDecoderThread( |
| + DemuxerStream* demuxer_stream, |
| + const PipelineStatusCB& filter_callback, |
| + const StatisticsCallback& stat_callback); |
| + void ReadOnDecoderThread(const ReadCB& callback); |
| + |
| + void GenerateFrameOnDecoderThread(); |
| + |
| + // Delivers the frame to |read_cb_| and resets the callback. |
| + void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); |
| + |
| + scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
| + VideoCapture::VideoCaptureCapability capability_; |
| + gfx::Size natural_size_; |
| + DecoderState state_; |
| + ReadCB read_cb_; |
| + StatisticsCallback statistics_callback_; |
| + |
| + base::TimeDelta frame_interval_ms_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FakeCaptureVideoDecoder); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_VIDEO_CAPTURE_FAKE_CAPTURE_VIDEO_DECODER_H_ |
| Property changes on: media/video/capture/fake_capture_video_decoder.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |