summaryrefslogtreecommitdiff
path: root/chromium/media/video
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-11-21 14:09:57 +0100
committerAndras Becsi <andras.becsi@digia.com>2013-11-29 15:14:36 +0100
commiteb32ba6f51d0c21d58cd7d89785285ff8fa64624 (patch)
tree2c7c940e1dbee81b89d935626110816b494aa32c /chromium/media/video
parent9427c1a0222ebd67efef1a2c7990a0fa5c9aac84 (diff)
downloadqtwebengine-chromium-eb32ba6f51d0c21d58cd7d89785285ff8fa64624.tar.gz
Update chromium to branch 1599.
Change-Id: I04e775a946a208bb4500d3b722bcb05c82b9d7cb Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/media/video')
-rw-r--r--chromium/media/video/capture/win/filter_base_win.cc2
-rw-r--r--chromium/media/video/capture/win/pin_base_win.cc2
-rw-r--r--chromium/media/video/video_encode_accelerator.cc11
-rw-r--r--chromium/media/video/video_encode_accelerator.h145
4 files changed, 4 insertions, 156 deletions
diff --git a/chromium/media/video/capture/win/filter_base_win.cc b/chromium/media/video/capture/win/filter_base_win.cc
index ddc68d68b2c..89309df694d 100644
--- a/chromium/media/video/capture/win/filter_base_win.cc
+++ b/chromium/media/video/capture/win/filter_base_win.cc
@@ -72,6 +72,8 @@ class PinEnumerator
STDMETHOD(Clone)(IEnumPins** clone) {
PinEnumerator* pin_enum = new PinEnumerator(filter_);
+ if (!pin_enum)
+ return E_OUTOFMEMORY;
pin_enum->AddRef();
pin_enum->index_ = index_;
*clone = pin_enum;
diff --git a/chromium/media/video/capture/win/pin_base_win.cc b/chromium/media/video/capture/win/pin_base_win.cc
index e912b84ec2a..7e2f7b095ad 100644
--- a/chromium/media/video/capture/win/pin_base_win.cc
+++ b/chromium/media/video/capture/win/pin_base_win.cc
@@ -93,6 +93,8 @@ class TypeEnumerator
STDMETHOD(Clone)(IEnumMediaTypes** clone) {
TypeEnumerator* type_enum = new TypeEnumerator(pin_);
+ if (!type_enum)
+ return E_OUTOFMEMORY;
type_enum->AddRef();
type_enum->index_ = index_;
*clone = type_enum;
diff --git a/chromium/media/video/video_encode_accelerator.cc b/chromium/media/video/video_encode_accelerator.cc
deleted file mode 100644
index 6309180bceb..00000000000
--- a/chromium/media/video/video_encode_accelerator.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2013 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.
-
-#include "media/video/video_encode_accelerator.h"
-
-namespace media {
-
-VideoEncodeAccelerator::~VideoEncodeAccelerator() {}
-
-} // namespace media
diff --git a/chromium/media/video/video_encode_accelerator.h b/chromium/media/video/video_encode_accelerator.h
deleted file mode 100644
index 8d4f56536bf..00000000000
--- a/chromium/media/video/video_encode_accelerator.h
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright 2013 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_VIDEO_ENCODE_ACCELERATOR_H_
-#define MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_
-
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "media/base/bitstream_buffer.h"
-#include "media/base/media_export.h"
-#include "media/base/video_decoder_config.h"
-#include "media/base/video_frame.h"
-
-namespace media {
-
-class BitstreamBuffer;
-class VideoFrame;
-
-// Video encoder interface.
-class MEDIA_EXPORT VideoEncodeAccelerator {
- public:
- virtual ~VideoEncodeAccelerator();
-
- // Specification of an encoding profile supported by an encoder.
- struct SupportedProfile {
- VideoCodecProfile profile;
- gfx::Size max_resolution;
- struct {
- uint32 numerator;
- uint32 denominator;
- } max_framerate;
- };
-
- // Enumeration of potential errors generated by the API.
- enum Error {
- // An operation was attempted during an incompatible encoder state.
- kIllegalStateError,
- // Invalid argument was passed to an API method.
- kInvalidArgumentError,
- // A failure occurred at the GPU process or one of its dependencies.
- // Examples of such failures include GPU hardware failures, GPU driver
- // failures, GPU library failures, GPU process programming errors, and so
- // on.
- kPlatformFailureError,
- };
-
- // Interface for clients that use VideoEncodeAccelerator.
- class MEDIA_EXPORT Client {
- public:
- // Callback to notify client that encoder has been successfully initialized.
- virtual void NotifyInitializeDone() = 0;
-
- // Callback to tell the client what size of frames and buffers to provide
- // for input and output. The VEA disclaims use or ownership of all
- // previously provided buffers once this callback is made.
- // Parameters:
- // |input_count| is the number of input VideoFrames required for encoding.
- // The client should be prepared to feed at least this many frames into the
- // encoder before being returned any input frames, since the encoder may
- // need to hold onto some subset of inputs as reference pictures.
- // |input_coded_size| is the logical size of the input frames (as reported
- // by VideoFrame::coded_size()) to encode, in pixels. The encoder may have
- // hardware alignment requirements that make this different from
- // |input_visible_size|, as requested in Initialize(), in which case the
- // input VideoFrame to Encode() should be padded appropriately.
- // |output_buffer_size| is the required size of output buffers for this
- // encoder in bytes.
- virtual void RequireBitstreamBuffers(unsigned int input_count,
- const gfx::Size& input_coded_size,
- size_t output_buffer_size) = 0;
-
- // Callback to deliver encoded bitstream buffers. Ownership of the buffer
- // is transferred back to the VEA::Client once this callback is made.
- // Parameters:
- // |bitstream_buffer_id| is the id of the buffer that is ready.
- // |payload_size| is the byte size of the used portion of the buffer.
- // |key_frame| is true if this delivered frame is a keyframe.
- virtual void BitstreamBufferReady(int32 bitstream_buffer_id,
- size_t payload_size,
- bool key_frame) = 0;
-
- // Error notification callback.
- virtual void NotifyError(Error error) = 0;
-
- protected:
- // Clients are not owned by VEA instances and should not be deleted through
- // these pointers.
- virtual ~Client() {}
- };
-
- // Video encoder functions.
-
- // Initialize the video encoder with a specific configuration. Called once
- // per encoder construction.
- // Parameters:
- // |input_format| is the frame format of the input stream (as would be
- // reported by VideoFrame::format() for frames passed to Encode()).
- // |input_visible_size| is the resolution of the input stream (as would be
- // reported by VideoFrame::visible_rect().size() for frames passed to
- // Encode()).
- // |output_profile| is the codec profile of the encoded output stream.
- // |initial_bitrate| is the initial bitrate of the encoded output stream,
- // in bits per second.
- // TODO(sheu): handle resolution changes. http://crbug.com/249944
- virtual void Initialize(media::VideoFrame::Format input_format,
- const gfx::Size& input_visible_size,
- VideoCodecProfile output_profile,
- uint32 initial_bitrate) = 0;
-
- // Encodes the given frame.
- // Parameters:
- // |frame| is the VideoFrame that is to be encoded.
- // |force_keyframe| forces the encoding of a keyframe for this frame.
- virtual void Encode(const scoped_refptr<VideoFrame>& frame,
- bool force_keyframe) = 0;
-
- // Send a bitstream buffer to the encoder to be used for storing future
- // encoded output. Each call here with a given |buffer| will cause the buffer
- // to be filled once, then returned with BitstreamBufferReady().
- // Parameters:
- // |buffer| is the bitstream buffer to use for output.
- virtual void UseOutputBitstreamBuffer(const BitstreamBuffer& buffer) = 0;
-
- // Request a change to the encoding parameters. This is only a request,
- // fulfilled on a best-effort basis.
- // Parameters:
- // |bitrate| is the requested new bitrate, in bits per second.
- // |framerate| is the requested new framerate, in frames per second.
- virtual void RequestEncodingParametersChange(uint32 bitrate,
- uint32 framerate) = 0;
-
- // Destroys the encoder: all pending inputs and outputs are dropped
- // immediately and the component is freed. This call may asynchronously free
- // system resources, but its client-visible effects are synchronous. After
- // this method returns no more callbacks will be made on the client. Deletes
- // |this| unconditionally, so make sure to drop all pointers to it!
- virtual void Destroy() = 0;
-};
-
-} // namespace media
-
-#endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_