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

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

Issue 10910293: Add is_encrypted() in VideoDecoderConfig. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move is_encrypted into VideoDecoderConfig. Created 8 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 | « no previous file | media/base/video_decoder_config.cc » ('j') | media/base/video_decoder_config.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string>
9
8 #include "base/basictypes.h" 10 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
10 #include "media/base/media_export.h" 12 #include "media/base/media_export.h"
11 #include "media/base/video_frame.h" 13 #include "media/base/video_frame.h"
12 #include "ui/gfx/rect.h" 14 #include "ui/gfx/rect.h"
13 #include "ui/gfx/size.h" 15 #include "ui/gfx/size.h"
14 16
15 namespace media { 17 namespace media {
16 18
17 enum VideoCodec { 19 enum VideoCodec {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 VideoDecoderConfig(); 68 VideoDecoderConfig();
67 69
68 // Constructs an initialized object. It is acceptable to pass in NULL for 70 // Constructs an initialized object. It is acceptable to pass in NULL for
69 // |extra_data|, otherwise the memory is copied. 71 // |extra_data|, otherwise the memory is copied.
70 VideoDecoderConfig(VideoCodec codec, 72 VideoDecoderConfig(VideoCodec codec,
71 VideoCodecProfile profile, 73 VideoCodecProfile profile,
72 VideoFrame::Format format, 74 VideoFrame::Format format,
73 const gfx::Size& coded_size, 75 const gfx::Size& coded_size,
74 const gfx::Rect& visible_rect, 76 const gfx::Rect& visible_rect,
75 const gfx::Size& natural_size, 77 const gfx::Size& natural_size,
76 const uint8* extra_data, size_t extra_data_size); 78 const uint8* extra_data, size_t extra_data_size,
79 bool is_encrypted);
77 80
78 ~VideoDecoderConfig(); 81 ~VideoDecoderConfig();
79 82
80 // Resets the internal state of this object. 83 // Resets the internal state of this object.
81 void Initialize(VideoCodec codec, 84 void Initialize(VideoCodec codec,
82 VideoCodecProfile profile, 85 VideoCodecProfile profile,
83 VideoFrame::Format format, 86 VideoFrame::Format format,
84 const gfx::Size& coded_size, 87 const gfx::Size& coded_size,
85 const gfx::Rect& visible_rect, 88 const gfx::Rect& visible_rect,
86 const gfx::Size& natural_size, 89 const gfx::Size& natural_size,
87 const uint8* extra_data, size_t extra_data_size, 90 const uint8* extra_data, size_t extra_data_size,
91 bool is_encrypted,
88 bool record_stats); 92 bool record_stats);
89 93
90 // Deep copies |video_config|. 94 // Deep copies |video_config|.
91 void CopyFrom(const VideoDecoderConfig& video_config); 95 void CopyFrom(const VideoDecoderConfig& video_config);
92 96
93 // Returns true if this object has appropriate configuration values, false 97 // Returns true if this object has appropriate configuration values, false
94 // otherwise. 98 // otherwise.
95 bool IsValidConfig() const; 99 bool IsValidConfig() const;
96 100
97 // Returns true if all fields in |config| match this config. 101 // Returns true if all fields in |config| match this config.
(...skipping 19 matching lines...) Expand all
117 121
118 // Final visible width and height of a video frame with aspect ratio taken 122 // Final visible width and height of a video frame with aspect ratio taken
119 // into account. 123 // into account.
120 gfx::Size natural_size() const; 124 gfx::Size natural_size() const;
121 125
122 // Optional byte data required to initialize video decoders, such as H.264 126 // Optional byte data required to initialize video decoders, such as H.264
123 // AAVC data. 127 // AAVC data.
124 uint8* extra_data() const; 128 uint8* extra_data() const;
125 size_t extra_data_size() const; 129 size_t extra_data_size() const;
126 130
131 // Whether the video stream is potentially encrypted.
132 // Note that in a potentially encrypted video stream, individual buffers
133 // can be encrypted or not encrypted.
134 bool is_encrypted() const;
135 void set_is_encrypted(bool is_encrypted);
scherkus (not reviewing) 2012/09/17 15:54:10 note that there are no other setters on this class
xhwang 2012/09/17 19:42:25 Done.
136
127 private: 137 private:
128 VideoCodec codec_; 138 VideoCodec codec_;
129 VideoCodecProfile profile_; 139 VideoCodecProfile profile_;
130 140
131 VideoFrame::Format format_; 141 VideoFrame::Format format_;
132 142
133 gfx::Size coded_size_; 143 gfx::Size coded_size_;
134 gfx::Rect visible_rect_; 144 gfx::Rect visible_rect_;
135 gfx::Size natural_size_; 145 gfx::Size natural_size_;
136 146
137 scoped_array<uint8> extra_data_; 147 scoped_array<uint8> extra_data_;
138 size_t extra_data_size_; 148 size_t extra_data_size_;
139 149
150 bool is_encrypted_;
151
140 DISALLOW_COPY_AND_ASSIGN(VideoDecoderConfig); 152 DISALLOW_COPY_AND_ASSIGN(VideoDecoderConfig);
141 }; 153 };
142 154
143 } // namespace media 155 } // namespace media
144 156
145 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ 157 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/video_decoder_config.cc » ('j') | media/base/video_decoder_config.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698