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

Side by Side Diff: content/browser/media/media_canplaytype_browsertest.cc

Issue 1292703005: Remove constraint_set_flag checks from ParseH264CodecID(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | media/base/mime_util.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 <string> 5 #include <string>
6 6
7 #include "content/browser/media/media_browsertest.h" 7 #include "content/browser/media/media_browsertest.h"
8 #include "content/public/test/browser_test_utils.h" 8 #include "content/public/test/browser_test_utils.h"
9 #include "content/public/test/content_browser_test_utils.h" 9 #include "content/public/test/content_browser_test_utils.h"
10 #include "content/shell/browser/shell.h" 10 #include "content/shell/browser/shell.h"
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 // 600 //
601 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.42001E\"'")); 601 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.42001E\"'"));
602 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.42E00A\"'")); 602 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.42E00A\"'"));
603 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.42G01E\"'")); 603 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.42G01E\"'"));
604 604
605 // The fourth digit must be 0. 605 // The fourth digit must be 0.
606 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.42E11E\"'")); 606 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.42E11E\"'"));
607 607
608 // 608 //
609 // Main Profile (77 == 0x4D). 609 // Main Profile (77 == 0x4D).
610 // The first four digits must be 4D40. 610 // The first two digits must be 4D. The second two must be valid hex, but
ddorwin 2015/08/20 20:18:05 The third digit must be valid hex. The fourth must
sandersd (OOO until July 31) 2015/08/20 20:26:06 Done.
611 // The last two digits must be any valid level. 611 // constraint_set_flags are ignored. The last two digits must be any valid
612 // level.
612 // 613 //
613 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.4D400A\"'")); 614 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.4D001E\"'"));
ddorwin 2015/08/20 20:18:05 If 4D40 is the "canonical" version (?), we should
sandersd (OOO until July 31) 2015/08/20 20:26:06 Not in any real sense. It's a popular way to mark
ddorwin 2015/08/20 20:42:38 If it's common, it's probably good to include here
614 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.4D401E\"'")); 615 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.4DE00A\"'"));
616 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.4DG01E\"'"));
615 617
616 // Other values are not allowed for the third and fourth digits. 618 // The fourth digit must be 0.
617 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.4D301E\"'")); 619 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.4DE11E\"'"));
618 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.4D501E\"'"));
619 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.4D411E\"'"));
620 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.4D4F1E\"'"));
621 620
622 // 621 //
623 // High Profile (100 == 0x64). 622 // High Profile (100 == 0x64).
624 // The first four digits must be 6400. 623 // The first two digits must be 64. The second two must be valid hex, but
ddorwin 2015/08/20 20:18:05 ditto
sandersd (OOO until July 31) 2015/08/20 20:26:06 Done.
625 // The last two digits must be any valid level. 624 // constraint_set_flags are ignored. The last two digits must be any valid
625 // level.
626 // 626 //
627 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.64000A\"'"));
628 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.64001E\"'")); 627 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.64001E\"'"));
629 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.64001F\"'")); 628 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc1.64E00A\"'"));
629 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.64G01E\"'"));
630 630
631 // Other values are not allowed for the third and fourth digits. 631 // The fourth digit must be 0.
632 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.64101E\"'")); 632 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.64E11E\"'"));
633 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.64f01E\"'"));
634 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.64011E\"'"));
635 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.640F1E\"'"));
636 633
637 // 634 //
638 // Other profiles are not known to be supported. 635 // Other profiles are not known to be supported.
639 // 636 //
640 637
641 // Extended Profile (88 == 0x58). 638 // Extended Profile (88 == 0x58).
642 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.58A01E\"'")); 639 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.58A01E\"'"));
643 } 640 }
644 641
645 // When modifying this test, also change CodecSupportTest_Avc1Variants. 642 // When modifying this test, also change CodecSupportTest_Avc1Variants.
(...skipping 26 matching lines...) Expand all
672 // 669 //
673 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.42001E\"'")); 670 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.42001E\"'"));
674 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.42E00A\"'")); 671 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.42E00A\"'"));
675 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.42G01E\"'")); 672 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.42G01E\"'"));
676 673
677 // The fourth digit must be 0. 674 // The fourth digit must be 0.
678 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.42E11E\"'")); 675 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.42E11E\"'"));
679 676
680 // 677 //
681 // Main Profile (77 == 0x4D). 678 // Main Profile (77 == 0x4D).
682 // The first four digits must be 4D40. 679 // The first two digits must be 4D. The second two must be valid hex, but
ddorwin 2015/08/20 20:18:05 same as above
sandersd (OOO until July 31) 2015/08/20 20:26:06 Done.
683 // The last two digits must be any valid level. 680 // constraint_set_flags are ignored. The last two digits must be any valid
681 // level.
684 // 682 //
685 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.4D400A\"'")); 683 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.4D001E\"'"));
686 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.4D401E\"'")); 684 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.4DE00A\"'"));
685 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.4DG01E\"'"));
687 686
688 // Other values are not allowed for the third and fourth digits. 687 // The fourth digit must be 0.
689 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.4D301E\"'")); 688 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.4DE11E\"'"));
690 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.4D501E\"'"));
691 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.4D411E\"'"));
692 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.4D4F1E\"'"));
693 689
694 // 690 //
695 // High Profile (100 == 0x64). 691 // High Profile (100 == 0x64).
696 // The first four digits must be 6400. 692 // The first two digits must be 64. The second two must be valid hex, but
697 // The last two digits must be any valid level. 693 // constraint_set_flags are ignored. The last two digits must be any valid
694 // level.
698 // 695 //
699 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.64000A\"'"));
700 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.64001E\"'")); 696 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.64001E\"'"));
701 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.64001F\"'")); 697 EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"avc3.64E00A\"'"));
698 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.64G01E\"'"));
702 699
703 // Other values are not allowed for the third and fourth digits. 700 // The fourth digit must be 0.
704 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.64101E\"'")); 701 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.64E11E\"'"));
705 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.64f01E\"'"));
706 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.64011E\"'"));
707 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.640F1E\"'"));
708 702
709 // 703 //
710 // Other profiles are not known to be supported. 704 // Other profiles are not known to be supported.
711 // 705 //
712 706
713 // Extended Profile (88 == 0x58). 707 // Extended Profile (88 == 0x58).
714 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.58A01E\"'")); 708 EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc3.58A01E\"'"));
715 } 709 }
716 710
717 // Tests AVC levels using AVC1 Baseline (0x42E0zz). 711 // Tests AVC levels using AVC1 Baseline (0x42E0zz).
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 CanPlay("'application/vnd.apple.mpegurl; " 997 CanPlay("'application/vnd.apple.mpegurl; "
1004 "codecs=\"avc1.42E01E, mp4a.40\"'")); 998 "codecs=\"avc1.42E01E, mp4a.40\"'"));
1005 EXPECT_EQ(maybeCanPlayHLS, 999 EXPECT_EQ(maybeCanPlayHLS,
1006 CanPlay("'application/vnd.apple.mpegurl; " 1000 CanPlay("'application/vnd.apple.mpegurl; "
1007 "codecs=\"avc3.42E01E, mp4a.40\"'")); 1001 "codecs=\"avc3.42E01E, mp4a.40\"'"));
1008 1002
1009 TestMPEGUnacceptableCombinations("application/vnd.apple.mpegurl"); 1003 TestMPEGUnacceptableCombinations("application/vnd.apple.mpegurl");
1010 } 1004 }
1011 1005
1012 } // namespace content 1006 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/base/mime_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698