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

Side by Side Diff: media/formats/mp2t/ts_section_psi.cc

Issue 1517473002: Support HLS MPEG2 TS with SAMPLE-AES encryption. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@encryption_scheme
Patch Set: README file update Created 4 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
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/mp2t/ts_section_psi.h" 5 #include "media/formats/mp2t/ts_section_psi.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8
9 #include "base/logging.h" 8 #include "base/logging.h"
10 #include "media/base/bit_reader.h" 9 #include "media/base/bit_reader.h"
11 #include "media/formats/mp2t/mp2t_common.h" 10 #include "media/formats/mp2t/mp2t_common.h"
12 11
13 static bool IsCrcValid(const uint8_t* buf, int size) { 12 static bool IsCrcValid(const uint8_t* buf, int size) {
14 uint32_t crc = 0xffffffffu; 13 uint32_t crc = 0xffffffffu;
15 const uint32_t kCrcPoly = 0x4c11db7; 14 const uint32_t kCrcPoly = 0x4c11db7;
16 15
17 for (int k = 0; k < size; k++) { 16 for (int k = 0; k < size; k++) {
18 int nbits = 8; 17 int nbits = 8;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 124
126 void TsSectionPsi::ResetPsiState() { 125 void TsSectionPsi::ResetPsiState() {
127 wait_for_pusi_ = true; 126 wait_for_pusi_ = true;
128 psi_byte_queue_.Reset(); 127 psi_byte_queue_.Reset();
129 leading_bytes_to_discard_ = 0; 128 leading_bytes_to_discard_ = 0;
130 } 129 }
131 130
132 } // namespace mp2t 131 } // namespace mp2t
133 } // namespace media 132 } // namespace media
134 133
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698