Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Unified Diff: media/video/capture/fake_capture_video_decoder.h

Issue 8887004: add components for integration test which will detect breakage of media pipeline with video captu... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: corresponding change with webkit patch Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698