2017-02-02 18:28:29 +00:00
|
|
|
# Copyright 2017 Google Inc. All rights reserved.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file or at
|
|
|
|
# https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
|
|
|
{
|
|
|
|
'includes': [
|
|
|
|
'../../common.gypi',
|
|
|
|
],
|
|
|
|
'targets': [
|
|
|
|
{
|
|
|
|
'target_name': 'crypto',
|
|
|
|
'type': '<(component)',
|
|
|
|
'sources': [
|
|
|
|
'encryption_handler.cc',
|
|
|
|
'encryption_handler.h',
|
|
|
|
],
|
|
|
|
'dependencies': [
|
|
|
|
'../base/media_base.gyp:media_base',
|
|
|
|
'../codecs/codecs.gyp:codecs',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'target_name': 'crypto_unittest',
|
|
|
|
'type': '<(gtest_target_type)',
|
|
|
|
'sources': [
|
|
|
|
'encryption_handler_unittest.cc',
|
|
|
|
],
|
|
|
|
'dependencies': [
|
|
|
|
'../../testing/gtest.gyp:gtest',
|
|
|
|
'../../testing/gmock.gyp:gmock',
|
Implement ChunkingHandler
This handler is a multi-in multi-out handler. If more than one input is
provided, there should be one and only one video stream; also, all inputs
should come from the same thread and are synchronized.
There can be multiple chunking handler running in different threads or even
different processes, we use the "consistent chunking algorithm" to make sure
the chunks in different streams are aligned without explicit communcating
with each other - which is not efficient and often difficult.
Consistent Chunking Algorithm:
1. Find the consistent chunkable boundary
Let the timestamps for video frames be (t1, t2, t3, ...). Then a
consistent chunkable boundary is simply the first chunkable boundary after
(tk / N) != (tk-1 / N), where '/' denotes integer division, and N is the
intended chunk duration.
2. Chunk only at the consistent chunkable boundary
This algorithm will make sure the chunks from different video streams are
aligned if they have aligned GoPs. However, this algorithm will only work
for video streams. To be able to chunk non video streams at similar
positions as video streams, ChunkingHandler is designed to accept one video
input and multiple non video inputs, the non video inputs are chunked when
the video input is chunked. If the inputs are synchronized - which is true
if the inputs come from the same demuxer, the video and non video chunks
are aligned.
Change-Id: Id3bad51ab14f311efdb8713b6cd36d36cf9e4639
2017-02-07 18:58:47 +00:00
|
|
|
'../base/media_base.gyp:media_handler_test_base',
|
2017-02-02 18:28:29 +00:00
|
|
|
'../test/media_test.gyp:media_test_support',
|
|
|
|
'crypto',
|
|
|
|
]
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|