Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 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 <map> |
| 8 | #include <ostream> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "base/time/time.h" |
| 12 | #include "media/base/video_decoder_config.h" |
| 13 | #include "ui/gfx/size.h" |
| 14 | |
| 15 | namespace media { |
| 16 | |
| 17 | // Data to represent limitations for a particular encoder config. |
Ben Murdoch | a3f7b4e | 2013-07-24 10:36:34 +0100 | [diff] [blame] | 18 | // The |max_bitrate| value is in bits per second. |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 19 | struct VideoEncodingConfig { |
| 20 | VideoCodec codec_type; |
| 21 | std::string codec_name; |
| 22 | gfx::Size max_resolution; |
Ben Murdoch | a3f7b4e | 2013-07-24 10:36:34 +0100 | [diff] [blame] | 23 | uint32 max_frames_per_second; |
| 24 | uint32 max_bitrate; |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | typedef std::vector<VideoEncodingConfig> VideoEncodingCapabilities; |
| 28 | |
| 29 | // Encoding parameters that can be configured during streaming without removing |
Ben Murdoch | a3f7b4e | 2013-07-24 10:36:34 +0100 | [diff] [blame] | 30 | // the bitstream first. The |target_bitrate| and |max_bitrate| values are in |
| 31 | // bits per second. |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 32 | struct RuntimeVideoEncodingParameters { |
Ben Murdoch | a3f7b4e | 2013-07-24 10:36:34 +0100 | [diff] [blame] | 33 | uint32 target_bitrate; |
| 34 | uint32 max_bitrate; |
| 35 | uint32 frames_per_second; |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | // Generic video encoding parameters to be configured during initialization |
| 39 | // time. |
| 40 | struct VideoEncodingParameters { |
| 41 | std::string codec_name; |
| 42 | gfx::Size resolution; |
| 43 | RuntimeVideoEncodingParameters runtime_params; |
| 44 | }; |
| 45 | |
| 46 | struct BufferEncodingMetadata { |
| 47 | base::Time timestamp; |
| 48 | bool key_frame; |
| 49 | }; |
| 50 | |
| 51 | } // namespace media |
| 52 | |
| 53 | #endif // MEDIA_VIDEO_VIDEO_ENCODE_TYPES_H_ |