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

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: Build fixes 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 (c) 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 = 1, // Key frame (implies also golden and altref refresh).
20 kVP8GoldenFrame = 1 << 1, // Golden frame refresh without key frame.
21 kVP8AltrefFrame = 1 << 2, // Altref frame refresh without key frame.
22 };
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 These values are not orthogonal and therefore are
Ville-Mikko Rautio 2013/03/19 16:45:43 Done.
23
24 // Data to represent limitations for a encoded video source.
25 struct MEDIA_EXPORT VideoEncodingLimits {
26 struct MEDIA_EXPORT EncoderConfig {
27 // Range to represent limitations in encoder controls.
28 struct Range {
29 int min;
30 int max;
31 int step;
32 };
33
34 EncoderConfig();
35 ~EncoderConfig();
36
37 VideoCodec codec;
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 Multi-profile codecs are going to need the profile
Ville-Mikko Rautio 2013/03/19 16:45:43 Done.
38 gfx::Size resolution;
39 std::vector<int> frames_per_second; // Maximum fps choices for stream.
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 s/for stream//
Ville-Mikko Rautio 2013/03/19 16:45:43 Done.
40 Range stream_count;
41 Range temporal_layer_count;
42 Range average_bitrate;
43 Range qp;
44 };
45
46 VideoEncodingLimits();
47 ~VideoEncodingLimits();
48
49 std::vector<EncoderConfig> configs; // A set of supported configs.
50 };
51
52 struct MEDIA_EXPORT TemporalLayerParameters {
53 bool enabled; // Flag telling whether temporal layer is enabled. If a layer
54 // is not enabled, any of the layers depending on it will be
55 // also disabled regardless of their parameters.
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 Does that mean that to tell if a layer is disabled
Ville-Mikko Rautio 2013/03/19 16:45:43 It says that a layer is disabled, all the direct a
56 int target_bitrate; // Target bitrate for the layer.
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 specify units: "in bytes/second" (if that's the ca
Ville-Mikko Rautio 2013/03/19 16:45:43 Done.
57 };
58
59 // Video encoder controls that can be configured during streaming for each
60 // stream.
61 struct MEDIA_EXPORT RuntimeVideoEncodingParameters {
62 RuntimeVideoEncodingParameters();
63 ~RuntimeVideoEncodingParameters();
64
65 int frames_per_second;
66 int max_bitrate;
67 int max_qp;
68 // Runtime parameters for each temporal layer. One element for each layer,
69 // first one for the base layer, second for first temporal enhancement layer
70 // and so on.
71 std::vector<TemporalLayerParameters> temporal_layer_params;
72 };
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 Shouldn't there be a way to indicate that the clie
Ville-Mikko Rautio 2013/03/19 16:45:43 Done.
73
74 // Video encoder parameters to be configured during initialization time for each
75 // stream.
76 struct MEDIA_EXPORT VideoEncodingParameters {
77 VideoCodec codec;
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 ditto profile
Ville-Mikko Rautio 2013/03/19 16:45:43 Done.
78 gfx::Size resolution;
79 int temporal_layer_count;
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 this is redundant to runtime_params.temporal_layer
Ville-Mikko Rautio 2013/03/19 16:45:43 Done.
80 RuntimeVideoEncodingParameters runtime_params;
81 };
82
83 struct MEDIA_EXPORT BufferEncodingMetadata {
84 base::Time timestamp;
85 int frame_type_flags;
86 int temporal_layer_id;
87 bool layer_sync; // Tells if the frame is temporal layer sync point.
88 bool droppable; // Tells whether the encoded buffer can be dropped without
89 // affecting the decoding of subsequent frames.
90 };
91
92 } // namespace media
93
94 // Pretty print operators to log structures found in the header conveniently.
Ami GONE FROM CHROMIUM 2013/03/18 22:53:45 ditto convert to ToDebugString()s on the respectiv
Ville-Mikko Rautio 2013/03/19 16:45:43 Done.
95 std::ostream& operator<<(
96 std::ostream& output,
97 const media::VideoEncodingLimits::EncoderConfig::Range& r);
98 std::ostream& operator<<(
99 std::ostream& output,
100 const media::VideoEncodingLimits::EncoderConfig& c);
101 std::ostream& operator<<(std::ostream& output,
102 const media::VideoEncodingLimits& l);
103
104 #endif // MEDIA_VIDEO_VIDEO_ENCODE_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698