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

Side by Side Diff: media/filters/h264_parser.cc

Issue 2273793002: Don't fail on profile changes in GpuVideoDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make MSE stop lying. Created 4 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
« no previous file with comments | « media/filters/h264_parser.h ('k') | media/formats/mp2t/es_parser_h264.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 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/filters/h264_parser.h" 5 #include "media/filters/h264_parser.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 *start_code_size = 0; 298 *start_code_size = 0;
299 start += std::min(*offset + 1, bytes_left); 299 start += std::min(*offset + 1, bytes_left);
300 } 300 }
301 } while (*start_code_size == 0); 301 } while (*start_code_size == 0);
302 302
303 // Update |*offset| to include the data we skipped over. 303 // Update |*offset| to include the data we skipped over.
304 *offset += start - data; 304 *offset += start - data;
305 return true; 305 return true;
306 } 306 }
307 307
308 VideoCodecProfile H264Parser::ProfileIDCToVideoCodecProfile(int profile_idc) {
309 switch (profile_idc) {
310 case H264SPS::kProfileIDCBaseline:
311 return H264PROFILE_BASELINE;
312 case H264SPS::kProfileIDCMain:
313 return H264PROFILE_MAIN;
314 case H264SPS::kProfileIDCHigh:
315 return H264PROFILE_HIGH;
316 case H264SPS::kProfileIDHigh10:
317 return H264PROFILE_HIGH10PROFILE;
318 case H264SPS::kProfileIDHigh422:
319 return H264PROFILE_HIGH422PROFILE;
320 case H264SPS::kProfileIDHigh444Predictive:
321 return H264PROFILE_HIGH444PREDICTIVEPROFILE;
322 case H264SPS::kProfileIDScalableBaseline:
323 return H264PROFILE_SCALABLEBASELINE;
324 case H264SPS::kProfileIDScalableHigh:
325 return H264PROFILE_SCALABLEHIGH;
326 case H264SPS::kProfileIDStereoHigh:
327 return H264PROFILE_STEREOHIGH;
328 case H264SPS::kProfileIDSMultiviewHigh:
329 return H264PROFILE_MULTIVIEWHIGH;
330 }
331 NOTREACHED() << "unknown video profile: " << profile_idc;
332 return VIDEO_CODEC_PROFILE_UNKNOWN;
333 }
334
308 H264Parser::Result H264Parser::ReadUE(int* val) { 335 H264Parser::Result H264Parser::ReadUE(int* val) {
309 int num_bits = -1; 336 int num_bits = -1;
310 int bit; 337 int bit;
311 int rest; 338 int rest;
312 339
313 // Count the number of contiguous zero bits. 340 // Count the number of contiguous zero bits.
314 do { 341 do {
315 READ_BITS_OR_RETURN(1, &bit); 342 READ_BITS_OR_RETURN(1, &bit);
316 num_bits++; 343 num_bits++;
317 } while (bit == 0); 344 } while (bit == 0);
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 1375
1349 default: 1376 default:
1350 DVLOG(4) << "Unsupported SEI message"; 1377 DVLOG(4) << "Unsupported SEI message";
1351 break; 1378 break;
1352 } 1379 }
1353 1380
1354 return kOk; 1381 return kOk;
1355 } 1382 }
1356 1383
1357 } // namespace media 1384 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/h264_parser.h ('k') | media/formats/mp2t/es_parser_h264.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698