New issue
Advanced search Search tips

Issue 675003 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Unify how to check whether a DecoderBuffer is encrypted

Project Member Reported by xhw...@chromium.org, Dec 16 2016

Issue description

Today there are two kinds of unencrypted DecoderBuffer:

// clear buffer in a clear stream
!buffer->decrypt_config()

// clear buffer in an encrypted stream
!buffer->decrypt_config()->is_encrypted())

This is very confusing. We should unify these two cases and make things simpler.
 
How about move |is_encrypted()| method from DecryptConfig to DecoderBuffer?

// call in this unique way
!buffer->is_encrypted()

bool DecoderBuffer::is_encrypted() {
  return decrypt_config_ && !decrypt_config_->key_id_.empty() && !decrypt_config_->iv_.empty();
}
This would work, but part of me feels that if the buffer is not encrypted, we probably should not set the DecryptConfig at all. I'll have to put more thoughts on it.
Project Member

Comment 3 by sheriffbot@chromium.org, Feb 16 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by xhw...@chromium.org, Feb 16 2018

Cc: -jrumm...@chromium.org xhw...@chromium.org
Labels: M-67
Owner: jrumm...@chromium.org
Status: Assigned (was: Untriaged)
Now we'll add EncryptionScheme, and that is another way to check whether a buffer is encrypted. But I still feel #2 is the best solution.
Labels: -M-67 M-68
Encrypted buffers won't have a DecryptConfig. CL out for review, but won't land before M68.
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9044a767f5066248501ff9806a080c7ab7561f60

commit 9044a767f5066248501ff9806a080c7ab7561f60
Author: John Rummell <jrummell@chromium.org>
Date: Thu Apr 19 01:24:07 2018

Add EncryptionMode and EncryptionPattern to DecryptConfig

In order to support different encryption schemes for protected content,
include the encryption mode and optional pattern in DecryptConfig.

This also changes the way that unencrypted buffers are tagged. They
no longer contain a DecryptConfig if the contents are unencrypted.

Future CLs will enable detection of different schemes as well as passing
it to the CDM.

BUG=657957,658026, 675003 
TEST=existing EME browser_tests pass

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ief02810cfe134e973ec39976277f3209683db612
Reviewed-on: https://chromium-review.googlesource.com/884947
Commit-Queue: John Rummell <jrummell@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kongqun Yang <kqyang@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551911}
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/chromecast/media/cma/base/decoder_buffer_adapter.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/chromecast/media/cma/base/decoder_buffer_adapter_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/chromecast/media/cma/test/frame_generator_for_test.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/content/browser/media/encrypted_media_browsertest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/BUILD.gn
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/bitstream_buffer.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/bitstream_buffer.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/decoder_buffer_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/decrypt_config.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/decrypt_config.h
[add] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/decrypt_config_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/encryption_pattern.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/encryption_pattern.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/encryption_scheme.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/fake_demuxer_stream.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/base/ipc/media_param_traits_macros.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/cdm/aes_decryptor.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/cdm/aes_decryptor_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/cdm/cdm_adapter.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/filters/android/media_codec_audio_decoder.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/filters/decrypting_audio_decoder_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/filters/decrypting_demuxer_stream.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/filters/decrypting_demuxer_stream_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/filters/decrypting_video_decoder_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/filters/gpu_video_decoder.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp2t/es_parser_adts.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp2t/es_parser_h264.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp2t/mp2t_stream_parser.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp2t/mp2t_stream_parser.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp2t/mp2t_stream_parser_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp2t/ts_section_cets_ecm.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp2t/ts_section_cets_ecm.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp4/box_definitions.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp4/box_definitions.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp4/mp4_stream_parser.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp4/track_run_iterator.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/mp4/track_run_iterator.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/webm/webm_crypto_helpers.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/webm/webm_crypto_helpers.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/formats/webm/webm_crypto_helpers_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/gpu/android/codec_wrapper.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/mojo/common/media_type_converters.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/mojo/common/media_type_converters_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/mojo/common/mojo_decoder_buffer_converter_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/mojo/interfaces/jpeg_decode_accelerator_typemap_traits.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/mojo/interfaces/media_types.mojom
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/mojo/interfaces/media_types.typemap
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/mojo/services/mojo_jpeg_decode_accelerator_service_unittest.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/remoting/proto_enum_utils.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/remoting/proto_enum_utils.h
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/remoting/proto_utils.cc
[modify] https://crrev.com/9044a767f5066248501ff9806a080c7ab7561f60/media/remoting/rpc.proto

Status: Fixed (was: Assigned)
buffer->decrypt_config() is null if the buffer is not encrypted and DecryptConfig::is_encrypted() is gone. Can't create a DecryptConfig for unencrypted content.

Sign in to add a comment