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

Side by Side Diff: media/base/video_decoder_config.h

Issue 7932005: Reland r101418: Fix aspect ratio and clarify video frame dimensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | media/base/video_decoder_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ 5 #ifndef MEDIA_BASE_VIDEO_DECODER_CONFIG_H_
6 #define MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ 6 #define MEDIA_BASE_VIDEO_DECODER_CONFIG_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
11 #include "ui/gfx/rect.h"
12 #include "ui/gfx/size.h"
11 13
12 namespace media { 14 namespace media {
13 15
14 enum VideoCodec { 16 enum VideoCodec {
15 kUnknown, 17 kUnknown,
16 kCodecH264, 18 kCodecH264,
17 kCodecVC1, 19 kCodecVC1,
18 kCodecMPEG2, 20 kCodecMPEG2,
19 kCodecMPEG4, 21 kCodecMPEG4,
20 kCodecTheora, 22 kCodecTheora,
21 kCodecVP8, 23 kCodecVP8,
22 24
23 // DO NOT ADD RANDOM VIDEO CODECS! 25 // DO NOT ADD RANDOM VIDEO CODECS!
24 // 26 //
25 // The only acceptable time to add a new codec is if there is production code 27 // The only acceptable time to add a new codec is if there is production code
26 // that uses said codec in the same CL. 28 // that uses said codec in the same CL.
27 }; 29 };
28 30
29 class MEDIA_EXPORT VideoDecoderConfig { 31 class MEDIA_EXPORT VideoDecoderConfig {
30 public: 32 public:
31 VideoDecoderConfig(VideoCodec codec, int width, int height, 33 VideoDecoderConfig(VideoCodec codec, const gfx::Size& coded_size,
32 int surface_width, int surface_height, 34 const gfx::Rect& visible_rect,
35 const gfx::Size& natural_size,
33 int frame_rate_numerator, int frame_rate_denominator, 36 int frame_rate_numerator, int frame_rate_denominator,
34 const uint8* extra_data, size_t extra_data_size); 37 const uint8* extra_data, size_t extra_data_size);
35 ~VideoDecoderConfig(); 38 ~VideoDecoderConfig();
36 39
37 VideoCodec codec() const; 40 VideoCodec codec() const;
38 int width() const; 41 gfx::Size coded_size() const;
39 int height() const; 42 gfx::Rect visible_rect() const;
40 int surface_width() const; 43 gfx::Size natural_size() const;
41 int surface_height() const;
42 int frame_rate_numerator() const; 44 int frame_rate_numerator() const;
43 int frame_rate_denominator() const; 45 int frame_rate_denominator() const;
44 uint8* extra_data() const; 46 uint8* extra_data() const;
45 size_t extra_data_size() const; 47 size_t extra_data_size() const;
46 48
47 private: 49 private:
48 VideoCodec codec_; 50 VideoCodec codec_;
49 51
50 // Container's concept of width and height of this video. 52 // Width and height of video frame immediately post-decode. Not all pixels
51 int width_; 53 // in this region are valid.
52 int height_; 54 gfx::Size coded_size_;
53 55
54 // Width and height of the display surface for this video. 56 // Region of |coded_size_| that is visible.
55 int surface_width_; 57 gfx::Rect visible_rect_;
56 int surface_height_; 58
59 // Natural width and height of the video, i.e. the visible dimensions
60 // after aspect ratio is applied.
61 gfx::Size natural_size_;
57 62
58 // Frame rate in seconds expressed as a fraction. 63 // Frame rate in seconds expressed as a fraction.
59 // TODO(scherkus): fairly certain decoders don't require frame rates. 64 // TODO(scherkus): fairly certain decoders don't require frame rates.
60 int frame_rate_numerator_; 65 int frame_rate_numerator_;
61 int frame_rate_denominator_; 66 int frame_rate_denominator_;
62 67
63 // Optional byte data required to initialize video decoders. 68 // Optional byte data required to initialize video decoders.
64 scoped_array<uint8> extra_data_; 69 scoped_array<uint8> extra_data_;
65 size_t extra_data_size_; 70 size_t extra_data_size_;
66 71
67 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoDecoderConfig); 72 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoDecoderConfig);
68 }; 73 };
69 74
70 } // namespace media 75 } // namespace media
71 76
72 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ 77 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_
OLDNEW
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | media/base/video_decoder_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698