Chromium Code Reviews| Index: media/video/video_encode_types.h |
| diff --git a/media/video/video_encode_types.h b/media/video/video_encode_types.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..79f567ed6c7e27dbf327a6207d1b542e0f7a3291 |
| --- /dev/null |
| +++ b/media/video/video_encode_types.h |
| @@ -0,0 +1,100 @@ |
| +// 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_TYPES_H_ |
| +#define MEDIA_VIDEO_VIDEO_ENCODE_TYPES_H_ |
| + |
| +#include <ostream> |
| +#include <vector> |
| + |
| +#include "base/time.h" |
| +#include "media/base/media_export.h" |
| +#include "media/base/video_decoder_config.h" |
| +#include "ui/gfx/size.h" |
| + |
| +namespace media { |
| + |
| +// Flags to request special frames for VP8. |
| +enum VP8SpecialFrameFlags { |
| + kVP8KeyFrame = 0, // Key frame (implies also golden and altref refresh). |
| + kVP8GoldenFrame, // Golden frame refresh without key frame. |
| + kVP8AltrefFrame, // Altref frame refresh without key frame. |
| + kVP8GoldenAndAltrefFrame, // Golden and altref refresh without key frame. |
| +}; |
| + |
| +// Data to represent limitations for a encoded video source. |
| +struct MEDIA_EXPORT VideoEncodingLimits { |
| + struct MEDIA_EXPORT EncoderConfig { |
| + // Range to represent limitations in encoder controls. |
| + struct Range { |
| + std::string ToDebugString() const; |
|
tommi (sloooow) - chröme
2013/03/21 14:48:05
#ifndef NDEBUG?
|
| + |
| + int min; |
| + int max; |
| + int step; |
| + }; |
| + |
| + EncoderConfig(); |
| + ~EncoderConfig(); |
| + |
| + std::string ToDebugString() const; |
|
tommi (sloooow) - chröme
2013/03/21 14:48:05
ditto, and throughout.
|
| + |
| + VideoCodecProfile profile; |
| + gfx::Size resolution; |
| + std::vector<int> frames_per_second; // Maximum fps choices. |
| + Range stream_count; |
| + Range temporal_layer_count; |
| + Range average_bitrate; |
| + Range qp; |
| + }; |
| + |
| + VideoEncodingLimits(); |
| + ~VideoEncodingLimits(); |
| + |
| + std::string ToDebugString() const; |
| + |
| + std::vector<EncoderConfig> configs; // A set of supported configs. |
| +}; |
| + |
| +struct MEDIA_EXPORT TemporalLayerParameters { |
| + bool enabled; // Flag telling whether temporal layer is enabled. If a layer |
| + // is not enabled, any of the layers depending on it will be |
| + // also disabled regardless of their parameters. |
| + int target_bitrate; // Target bitrate in bits/s for the layer. |
| +}; |
| + |
| +// Video encoder controls that can be configured during streaming for each |
| +// stream. |
| +struct MEDIA_EXPORT RuntimeVideoEncodingParameters { |
| + RuntimeVideoEncodingParameters(); |
| + ~RuntimeVideoEncodingParameters(); |
| + |
| + int frames_per_second; // set to 0 to let the encoder select freely. |
| + int max_bitrate; // set to 0 to let the encoder select freely. |
| + int max_qp; // set to 0 to let the encoder select freely. |
| + // Runtime parameters for each temporal layer. One element for each layer, |
| + // first one for the base layer, second for first temporal enhancement layer |
| + // and so on. Leave empty to let the encoder decide on temporal layering. |
| + std::vector<TemporalLayerParameters> temporal_layer_params; |
| +}; |
| + |
| +// Video encoder parameters to be configured during initialization time for each |
| +// stream. |
| +struct MEDIA_EXPORT VideoEncodingParameters { |
| + VideoCodecProfile profile; |
| + gfx::Size resolution; |
| + RuntimeVideoEncodingParameters runtime_params; |
| +}; |
| + |
| +struct MEDIA_EXPORT BufferEncodingMetadata { |
| + base::Time timestamp; |
| + int frame_type_flags; |
| + int temporal_layer_id; |
| + bool layer_sync; // Tells if the frame is temporal layer sync point. |
| + bool droppable; // Tells whether the encoded buffer can be dropped without |
| + // affecting the decoding of subsequent frames. |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_VIDEO_VIDEO_ENCODE_TYPES_H_ |