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

Unified Diff: media/filters/test_video_decoder.h

Issue 149423: Converted remaining tests to use gmock and deleted all old mocking code. (Closed)
Patch Set: Fix again Created 11 years, 5 months 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
« no previous file with comments | « media/filters/ffmpeg_glue_unittest.cc ('k') | media/filters/test_video_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/test_video_decoder.h
diff --git a/media/filters/test_video_decoder.h b/media/filters/test_video_decoder.h
deleted file mode 100644
index bb82c365efa43f0b57a72337db1a4add9c5456a9..0000000000000000000000000000000000000000
--- a/media/filters/test_video_decoder.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2009 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_FILTERS_TEST_VIDEO_DECODER_H_
-#define MEDIA_FILTERS_TEST_VIDEO_DECODER_H_
-
-#include <string>
-
-#include "media/base/buffers.h"
-#include "media/base/factory.h"
-#include "media/base/filters.h"
-#include "media/base/mock_media_filters.h"
-#include "media/base/video_frame_impl.h"
-#include "media/filters/decoder_base.h"
-
-namespace media {
-
-class TestVideoDecoder : public DecoderBase<VideoDecoder, VideoFrame> {
- public:
- TestVideoDecoder()
- : video_width_(0),
- video_height_(0) {
- }
-
- bool OnInitialize(DemuxerStream* demuxer_stream) {
- const MediaFormat& media_format = demuxer_stream->media_format();
- std::string mime_type;
- int width, height;
- if (media_format.GetAsString(MediaFormat::kMimeType, &mime_type) &&
- mime_type.compare(mime_type::kH264AnnexB) == 0 &&
- media_format.GetAsInteger(MediaFormat::kWidth, &width) &&
- media_format.GetAsInteger(MediaFormat::kHeight, &height)) {
- video_width_ = width;
- video_height_ = height;
- media_format_.SetAsString(MediaFormat::kMimeType,
- mime_type::kUncompressedVideo);
- media_format_.SetAsInteger(MediaFormat::kWidth, width);
- media_format_.SetAsInteger(MediaFormat::kHeight, height);
- return true;
- }
- return false;
- }
-
- void OnDecode(Buffer* buffer) {
- scoped_refptr<VideoFrame> frame;
- VideoFrameImpl::CreateFrame(VideoSurface::YV12,
- video_width_,
- video_height_,
- buffer->GetTimestamp(),
- buffer->GetDuration(),
- &frame);
- if (frame) {
- old_mocks::MockVideoDecoder::InitializeYV12Frame(frame, 0.5f);
- EnqueueResult(frame);
- } else {
- host_->Error(PIPELINE_ERROR_OUT_OF_MEMORY);
- }
- }
-
- static bool IsMediaFormatSupported(const MediaFormat& media_format) {
- std::string mime_type;
- return (media_format.GetAsString(MediaFormat::kMimeType, &mime_type) &&
- mime_type == mime_type::kH264AnnexB);
- }
-
- private:
- friend class scoped_refptr<TestVideoDecoder>;
- virtual ~TestVideoDecoder() {}
-
- size_t video_width_;
- size_t video_height_;
-
- DISALLOW_COPY_AND_ASSIGN(TestVideoDecoder);
-};
-
-} // namespace
-
-#endif // MEDIA_FILTERS_TEST_VIDEO_DECODER_H_
« no previous file with comments | « media/filters/ffmpeg_glue_unittest.cc ('k') | media/filters/test_video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698