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

Side by Side Diff: media/video/video_encode_types.h

Issue 12379011: Interfaces for encoded video sources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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 unified diff | Download patch
OLDNEW
(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 kVP8GoldenAndAltrefFrame, // Golden and altref refresh without key frame.
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;
tommi (sloooow) - chröme 2013/03/21 14:48:05 #ifndef NDEBUG?
31
32 int min;
33 int max;
34 int step;
35 };
36
37 EncoderConfig();
38 ~EncoderConfig();
39
40 std::string ToDebugString() const;
tommi (sloooow) - chröme 2013/03/21 14:48:05 ditto, and throughout.
41
42 VideoCodecProfile profile;
43 gfx::Size resolution;
44 std::vector<int> frames_per_second; // Maximum fps choices.
45 Range stream_count;
46 Range temporal_layer_count;
47 Range average_bitrate;
48 Range qp;
49 };
50
51 VideoEncodingLimits();
52 ~VideoEncodingLimits();
53
54 std::string ToDebugString() const;
55
56 std::vector<EncoderConfig> configs; // A set of supported configs.
57 };
58
59 struct MEDIA_EXPORT TemporalLayerParameters {
60 bool enabled; // Flag telling whether temporal layer is enabled. If a layer
61 // is not enabled, any of the layers depending on it will be
62 // also disabled regardless of their parameters.
63 int target_bitrate; // Target bitrate in bits/s for the layer.
64 };
65
66 // Video encoder controls that can be configured during streaming for each
67 // stream.
68 struct MEDIA_EXPORT RuntimeVideoEncodingParameters {
69 RuntimeVideoEncodingParameters();
70 ~RuntimeVideoEncodingParameters();
71
72 int frames_per_second; // set to 0 to let the encoder select freely.
73 int max_bitrate; // set to 0 to let the encoder select freely.
74 int max_qp; // set to 0 to let the encoder select freely.
75 // Runtime parameters for each temporal layer. One element for each layer,
76 // first one for the base layer, second for first temporal enhancement layer
77 // and so on. Leave empty to let the encoder decide on temporal layering.
78 std::vector<TemporalLayerParameters> temporal_layer_params;
79 };
80
81 // Video encoder parameters to be configured during initialization time for each
82 // stream.
83 struct MEDIA_EXPORT VideoEncodingParameters {
84 VideoCodecProfile profile;
85 gfx::Size resolution;
86 RuntimeVideoEncodingParameters runtime_params;
87 };
88
89 struct MEDIA_EXPORT BufferEncodingMetadata {
90 base::Time timestamp;
91 int frame_type_flags;
92 int temporal_layer_id;
93 bool layer_sync; // Tells if the frame is temporal layer sync point.
94 bool droppable; // Tells whether the encoded buffer can be dropped without
95 // affecting the decoding of subsequent frames.
96 };
97
98 } // namespace media
99
100 #endif // MEDIA_VIDEO_VIDEO_ENCODE_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698