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

Side by Side Diff: media/formats/webm/webm_video_client.cc

Issue 231283005: Add live mode detection in WebM MediaSource parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "media/formats/webm/webm_video_client.h" 5 #include "media/formats/webm/webm_video_client.h"
6 6
7 #include "media/base/video_decoder_config.h" 7 #include "media/base/video_decoder_config.h"
8 #include "media/formats/webm/webm_constants.h" 8 #include "media/formats/webm/webm_constants.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 12 matching lines...) Expand all
23 crop_bottom_ = -1; 23 crop_bottom_ = -1;
24 crop_top_ = -1; 24 crop_top_ = -1;
25 crop_left_ = -1; 25 crop_left_ = -1;
26 crop_right_ = -1; 26 crop_right_ = -1;
27 display_width_ = -1; 27 display_width_ = -1;
28 display_height_ = -1; 28 display_height_ = -1;
29 display_unit_ = -1; 29 display_unit_ = -1;
30 alpha_mode_ = -1; 30 alpha_mode_ = -1;
31 } 31 }
32 32
33 bool WebMVideoClient::InitializeConfig( 33 bool WebMVideoClient::InitializeConfig(const std::string& codec_id,
34 const std::string& codec_id, const std::vector<uint8>& codec_private, 34 const std::vector<uint8>& codec_private,
35 bool is_encrypted, VideoDecoderConfig* config) { 35 bool is_encrypted,
36 bool live_mode,
37 VideoDecoderConfig* config) {
36 DCHECK(config); 38 DCHECK(config);
37 39
38 VideoCodec video_codec = kUnknownVideoCodec; 40 VideoCodec video_codec = kUnknownVideoCodec;
39 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; 41 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
40 if (codec_id == "V_VP8") { 42 if (codec_id == "V_VP8") {
41 video_codec = kCodecVP8; 43 video_codec = kCodecVP8;
42 profile = VP8PROFILE_MAIN; 44 profile = VP8PROFILE_MAIN;
43 } else if (codec_id == "V_VP9") { 45 } else if (codec_id == "V_VP9") {
44 video_codec = kCodecVP9; 46 video_codec = kCodecVP9;
45 profile = VP9PROFILE_MAIN; 47 profile = VP9PROFILE_MAIN;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 93 }
92 const uint8* extra_data = NULL; 94 const uint8* extra_data = NULL;
93 size_t extra_data_size = 0; 95 size_t extra_data_size = 0;
94 if (codec_private.size() > 0) { 96 if (codec_private.size() > 0) {
95 extra_data = &codec_private[0]; 97 extra_data = &codec_private[0];
96 extra_data_size = codec_private.size(); 98 extra_data_size = codec_private.size();
97 } 99 }
98 100
99 config->Initialize( 101 config->Initialize(
100 video_codec, profile, format, coded_size, visible_rect, natural_size, 102 video_codec, profile, format, coded_size, visible_rect, natural_size,
101 extra_data, extra_data_size, is_encrypted, true); 103 extra_data, extra_data_size, is_encrypted, live_mode, true);
102 return config->IsValidConfig(); 104 return config->IsValidConfig();
103 } 105 }
104 106
105 bool WebMVideoClient::OnUInt(int id, int64 val) { 107 bool WebMVideoClient::OnUInt(int id, int64 val) {
106 int64* dst = NULL; 108 int64* dst = NULL;
107 109
108 switch (id) { 110 switch (id) {
109 case kWebMIdPixelWidth: 111 case kWebMIdPixelWidth:
110 dst = &pixel_width_; 112 dst = &pixel_width_;
111 break; 113 break;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // Accept binary fields we don't care about for now. 156 // Accept binary fields we don't care about for now.
155 return true; 157 return true;
156 } 158 }
157 159
158 bool WebMVideoClient::OnFloat(int id, double val) { 160 bool WebMVideoClient::OnFloat(int id, double val) {
159 // Accept float fields we don't care about for now. 161 // Accept float fields we don't care about for now.
160 return true; 162 return true;
161 } 163 }
162 164
163 } // namespace media 165 } // namespace media
OLDNEW
« media/formats/webm/webm_stream_parser.cc ('K') | « media/formats/webm/webm_video_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698