Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 #ifndef MEDIA_VIDEO_VIDEO_ENCODE_TYPES_H_ | |
| 5 #define MEDIA_VIDEO_VIDEO_ENCODE_TYPES_H_ | |
| 6 | |
| 7 #include <ostream> | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/time.h" | |
| 11 #include "media/base/media_export.h" | |
| 12 #include "media/base/video_decoder_config.h" | |
| 13 #include "ui/gfx/size.h" | |
| 14 | |
| 15 namespace media { | |
| 16 | |
| 17 // Flags to request special frames for VP8. | |
| 18 enum VP8SpecialFrameFlags { | |
| 19 kVP8KeyFrame = 0, // Key frame (implies also golden and altref refresh). | |
| 20 kVP8GoldenFrame, // Golden frame refresh without key frame. | |
| 21 kVP8AltrefFrame, // Altref frame refresh without key frame. | |
| 22 kVP9GoldenAndAltrefFrame, // Golden and altref refresh without key frame. | |
|
Ami GONE FROM CHROMIUM
2013/03/19 18:01:49
whoah vp9??
vmr
2013/03/20 12:09:14
I've looked at this for too long and getting blind
| |
| 23 }; | |
| 24 | |
| 25 // Data to represent limitations for a encoded video source. | |
| 26 struct MEDIA_EXPORT VideoEncodingLimits { | |
| 27 struct MEDIA_EXPORT EncoderConfig { | |
| 28 // Range to represent limitations in encoder controls. | |
| 29 struct Range { | |
| 30 std::string ToDebugString() const; | |
| 31 | |
| 32 int min; | |
| 33 int max; | |
| 34 int step; | |
| 35 }; | |
| 36 | |
| 37 EncoderConfig(); | |
| 38 ~EncoderConfig(); | |
| 39 | |
| 40 std::string ToDebugString() const; | |
| 41 | |
| 42 VideoCodec codec; | |
| 43 VideoCodecProfile profile; | |
|
Ami GONE FROM CHROMIUM
2013/03/19 18:01:49
Having profile means you don't need codec.
vmr
2013/03/20 12:09:14
Done.
| |
| 44 gfx::Size resolution; | |
| 45 std::vector<int> frames_per_second; // Maximum fps choices. | |
| 46 Range stream_count; | |
| 47 Range temporal_layer_count; | |
| 48 Range average_bitrate; | |
| 49 Range qp; | |
| 50 }; | |
| 51 | |
| 52 VideoEncodingLimits(); | |
| 53 ~VideoEncodingLimits(); | |
| 54 | |
| 55 std::string ToDebugString() const; | |
| 56 | |
| 57 std::vector<EncoderConfig> configs; // A set of supported configs. | |
| 58 }; | |
| 59 | |
| 60 struct MEDIA_EXPORT TemporalLayerParameters { | |
| 61 bool enabled; // Flag telling whether temporal layer is enabled. If a layer | |
| 62 // is not enabled, any of the layers depending on it will be | |
| 63 // also disabled regardless of their parameters. | |
| 64 int target_bitrate; // Target bitrate in bits/s for the layer. | |
| 65 }; | |
| 66 | |
| 67 // Video encoder controls that can be configured during streaming for each | |
| 68 // stream. | |
| 69 struct MEDIA_EXPORT RuntimeVideoEncodingParameters { | |
| 70 RuntimeVideoEncodingParameters(); | |
| 71 ~RuntimeVideoEncodingParameters(); | |
| 72 | |
| 73 int frames_per_second; // set to 0 to let the encoder select freely. | |
| 74 int max_bitrate; // set to 0 to let the encoder select freely. | |
| 75 int max_qp; // set to 0 to let the encoder select freely. | |
| 76 // Runtime parameters for each temporal layer. One element for each layer, | |
| 77 // first one for the base layer, second for first temporal enhancement layer | |
| 78 // and so on. Leave empty to let the encoder decide on temporal layering. | |
| 79 std::vector<TemporalLayerParameters> temporal_layer_params; | |
| 80 }; | |
| 81 | |
| 82 // Video encoder parameters to be configured during initialization time for each | |
| 83 // stream. | |
| 84 struct MEDIA_EXPORT VideoEncodingParameters { | |
| 85 VideoCodec codec; | |
|
Ami GONE FROM CHROMIUM
2013/03/19 18:01:49
ditto drop codec in favor of profile.
vmr
2013/03/20 12:09:14
Done.
| |
| 86 VideoCodecProfile profile; | |
| 87 gfx::Size resolution; | |
| 88 RuntimeVideoEncodingParameters runtime_params; | |
| 89 }; | |
| 90 | |
| 91 struct MEDIA_EXPORT BufferEncodingMetadata { | |
| 92 base::Time timestamp; | |
| 93 int frame_type_flags; | |
| 94 int temporal_layer_id; | |
| 95 bool layer_sync; // Tells if the frame is temporal layer sync point. | |
| 96 bool droppable; // Tells whether the encoded buffer can be dropped without | |
| 97 // affecting the decoding of subsequent frames. | |
| 98 }; | |
| 99 | |
| 100 } // namespace media | |
| 101 | |
| 102 #endif // MEDIA_VIDEO_VIDEO_ENCODE_TYPES_H_ | |
| OLD | NEW |