diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 20:44:17 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 20:44:17 +0000 |
commit | d0fe478040d70a386c8d43812e06b0396713cd9c (patch) | |
tree | c353338e11054c9bfc2ea401dafafa7531122388 /remoting/host/video_frame_recorder.h | |
parent | d27f1e265ea0f14fce83cef776a65d9a1fac0653 (diff) | |
download | chromium_src-d0fe478040d70a386c8d43812e06b0396713cd9c.zip chromium_src-d0fe478040d70a386c8d43812e06b0396713cd9c.tar.gz chromium_src-d0fe478040d70a386c8d43812e06b0396713cd9c.tar.bz2 |
Revert of Add VideoFrameRecorder for use recording test frame sequences. (https://codereview.chromium.org/339073002/)
Reason for revert:
Brand new test fails in ASAN:
Direct leak of 112 byte(s) in 1 object(s) allocated from:
#0 0x462ccb in operator new(unsigned long) /usr/local/google/work/chromium/src/third_party/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:55
#1 0x7ee8f9 in CreateNextFrame remoting/host/video_frame_recorder_unittest.cc:96
#2 0x7ee8f9 in remoting::VideoFrameRecorderTest::CreateTestFrames() remoting/host/video_frame_recorder_unittest.cc:112
#3 0x7f1184 in remoting::VideoFrameRecorderTest_EncodeButDontRecord_Test::TestBody() remoting/host/video_frame_recorder_unittest.cc:269
#4 0xb3bf38 in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2045
#5 0xb3bf38 in testing::Test::Run() testing/gtest/src/gtest.cc:2061
#6 0xb3e1c9 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2237
#7 0xb3ef56 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2344
#8 0xb5206a in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4065
#9 0xb516a0 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2045
#10 0xb516a0 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:3697
#11 0xab66bc in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2231
#12 0xab66bc in base::TestSuite::Run() base/test/test_suite.cc:227
#13 0xaada32 in Run base/callback.h:401
#14 0xaada32 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int ()> const&, int, bool, base::Callback<void ()> const&) base/test/launcher/unit_test_launcher.cc:498
#15 0xaad3ad in base::LaunchUnitTests(int, char**, base::Callback<int ()> const&) base/test/launcher/unit_test_launcher.cc:553
#16 0x4e8067 in main chrome/test/base/run_all_remoting_unittests.cc:31
#17 0x7f1f660df76c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
Original issue's description:
> Add VideoFrameRecorder for use recording test frame sequences.
>
> This will be used to record representative frame sequences for performance evaluation of the new VP9 encoder.
>
> BUG=260879
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279795
TBR=sergeyu@chromium.org,wez@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=260879
Review URL: https://codereview.chromium.org/350903003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279805 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/video_frame_recorder.h')
-rw-r--r-- | remoting/host/video_frame_recorder.h | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/remoting/host/video_frame_recorder.h b/remoting/host/video_frame_recorder.h deleted file mode 100644 index c204c9a..0000000 --- a/remoting/host/video_frame_recorder.h +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2014 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 REMOTING_HOST_VIDEO_FRAME_RECORDER_H_ -#define REMOTING_HOST_VIDEO_FRAME_RECORDER_H_ - -#include <stdint.h> -#include <list> - -#include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" -#include "base/memory/weak_ptr.h" -#include "base/single_thread_task_runner.h" - -namespace webrtc { -class DesktopFrame; -} - -namespace remoting { - -class VideoEncoder; - -// Allows sequences of DesktopFrames passed to a VideoEncoder to be recorded. -// -// VideoFrameRecorder is design to support applications which use a dedicated -// thread for video encoding, but need to manage that process from a "main" -// or "control" thread. -// -// On the control thread: -// 1. Create the VideoFrameRecorder on the controlling thread. -// 2. Specify the amount of memory that may be used for recording. -// 3. Call WrapVideoEncoder(), passing the actual VideoEncoder that will be -// used to encode frames. -// 4. Hand the returned wrapper VideoEncoder of to the video encoding thread, -// to call in place of the actual VideoEncoder. -// 5. Start/stop frame recording as necessary. -// 6. Use NextFrame() to read each recorded frame in sequence. -// -// The wrapper VideoEncoder is designed to be handed off to the video encoding -// thread, and used and torn down there. -// -// The VideoFrameRecorder and VideoEncoder may be torn down in any order; frame -// recording will stop as soon as either is destroyed. - -class VideoFrameRecorder { - public: - VideoFrameRecorder(); - virtual ~VideoFrameRecorder(); - - // Wraps the supplied VideoEncoder, returning a replacement VideoEncoder that - // will route frames to the recorder, as well as passing them for encoding. - // This may be called at most once on each VideoFrameRecorder instance. - scoped_ptr<VideoEncoder> WrapVideoEncoder(scoped_ptr<VideoEncoder> encoder); - - // Enables/disables frame recording. Frame recording is initially disabled. - void SetEnableRecording(bool enable_recording); - - // Sets the maximum number of bytes of pixel data that may be recorded. - // When this maximum is reached older frames will be discard to make space - // for new ones. - void SetMaxContentBytes(int64_t max_content_bytes); - - // Pops the next recorded frame in the sequence, and returns it. - scoped_ptr<webrtc::DesktopFrame> NextFrame(); - - private: - class RecordingVideoEncoder; - friend class RecordingVideoEncoder; - - void SetEncoderTaskRunner(scoped_refptr<base::TaskRunner> task_runner); - void RecordFrame(scoped_ptr<webrtc::DesktopFrame> frame); - - // The recorded frames, in sequence. - std::list<webrtc::DesktopFrame*> recorded_frames_; - - // Size of the recorded frames' content, in bytes. - int64_t content_bytes_; - - // Size that recorded frames' content must not exceed. - int64_t max_content_bytes_; - - // True if recording is started, false otherwise. - bool enable_recording_; - - // Task runner on which the wrapper VideoEncoder is being run. - scoped_refptr<base::TaskRunner> encoder_task_runner_; - - // Weak reference to the wrapper VideoEncoder, to use to control it. - base::WeakPtr<RecordingVideoEncoder> recording_encoder_; - - scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; - base::WeakPtrFactory<VideoFrameRecorder> weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(VideoFrameRecorder); -}; - -} // namespace remoting - -#endif // REMOTING_HOST_VIDEO_FRAME_RECORDER_H_ |