31 Commits

Author SHA1 Message Date
Tom Finegan
9fb774ab80 Add missing include in webm2pes.cc.
We need <algorithm> on some platforms.

Change-Id: I65fa3ad52265b05c4141e14d97d6de0af1649b29
2017-01-18 07:26:30 -08:00
Tom Finegan
0c0ecd0f24 vpxpes_parser: Add start code emulation prevention support.
Remove bytes inserted to avoid start code emulation. Operates on:
- PES optional header
- BCMV header
- payloads.

Transforms the following byte sequences as noted (left converts to
right):
  0x00 0x00 0x03 0x01  =>  0x00 0x00 0x01
  0x00 0x00 0x03 0x03  =>  0x00 0x00 0x03

Change-Id: I09ae2d5bf03dfc1ade785ee89a773509eca8330c
2016-08-11 08:45:31 -07:00
Tom Finegan
639a4bc3b1 webm2pes: Remove debug printfs().
Change-Id: I13ba6590c63e7fef14efee812095ac704ef8b69e
2016-08-10 14:56:33 -07:00
Tom Finegan
9a51102cb5 webm2pes: fflush() in the correct conversion function.
Change-Id: I79db8b24178d4e7ba205995525b74a09efef8a04
2016-08-10 14:56:33 -07:00
Tom Finegan
dc7f15559f webm2pes: Track total bytes written.
Change-Id: I78807280cbd05f642215c83d5db4d04837c06438
2016-08-10 14:56:33 -07:00
Tom Finegan
e1fe7627c8 webm2pes: Add test for mux/demux of large input.
Change-Id: I253aa49aa3757682dbba83bd9ba6dd1e93d7ccce
2016-08-08 11:15:29 -07:00
Tom Finegan
1b24a792e3 vpxpes_parser: Read and store PTS when present.
Change-Id: I11acb45b26eeea6f5945c04bb447937ba2ffca9f
2016-08-08 11:15:23 -07:00
Tom Finegan
6cf0a0f400 vpxpes_parser: Store frame payloads.
libwebm_util:
- Add 90khz -> nanosecond conversion.

vpxpes_parser:
- Get rid of VpxPesParser::VpxFrame and use VideoFrame.
- Store/Accumulate (when neccessary) PES payloads in
  VideoFrames.
- Change type of size constants from int to size_t.
- Return offset accounting for origin from FindStartCode().
- Check all PTS marker bits (instead of checking the second
  marker twice).

video_frame:
- Add nanosecond_pts mutator.

webm2pes:
- Write DTS/PTS presence flag correctly when PTS is not
  present.

Change-Id: I10f16cd03bb3a51205a25331527ddceb3769ba03
2016-08-08 11:14:03 -07:00
Tom Finegan
24be76dcb2 webm2pes: Replace VpxFrame with VideoFrame.
VideoFrame was created in order to get rid of the two
slightly different VpxFrame implementations. This patch
gets rid of Webm2Pes's version.

Change-Id: I5af29d5ca717121ee7ab30f28e42d2a43ea5abb0
2016-07-22 15:07:42 -07:00
Tom Finegan
e6415af941 webm2pes: Make WritePesPacket() a public method.
WritePesPacket() now takes a VpxFrame as input and a
PacketDataBuffer* as an output  parameter, and avoids
using members entirely. This facilitates deeper testing
of Webm2Pes without requiring friendship with test
classes and methods.

Change-Id: I076db8900cc1a5c864b54f5fe3403fb05b4bd835
2016-07-20 17:36:46 -07:00
Tom Finegan
8f840ddaa3 webm2pes: Move frame read out of PES packet write method.
Makes writing tests easier by allowing caller to pass data
for packetizing directly into the method.

Change-Id: I553fa8c1636041c4a5ff043862918a5cdc9163ba
2016-07-20 14:00:36 -07:00
Tom Finegan
448af971d2 webm2pes: Restore frame fragmentation support.
Cap packet payload at 32 kB. Update test to expect non-zero
packet length.

Change-Id: Ibb68a4ef8d32c049c492ae546c631ef6376e3ffd
2016-07-18 14:32:02 -07:00
Tom Finegan
900d322cc8 vpxpes_parser/webm2pes: BCMV and PTS fixes.
- Write BCMV length value big endian and include BCMV header
  size.
- Write PTS bits big endian.

Change-Id: I8cd72c233c21f5909438f5a3bb817e9477bdfcfb
2016-06-02 17:05:09 -07:00
Tom Finegan
4b735452bb webm2pes: Add start code emulation prevention.
- Make start codes reliable for VPx in PES.
- Stop setting the PES size field and stop splitting packets when
  larger than UINT16_MAX (always set 0; rely on start codes to find
  packet boundaries).

Change-Id: I402e91c26562e930f61543ca59223b83cc92be29
2016-06-02 17:05:07 -07:00
Tom Finegan
a8ffbd4ed2 webm2pes: Fix format specifier warnings.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1207

Change-Id: If60866f8e60969bc6cbaef8eee72a805270bf65d
2016-05-06 11:40:38 -07:00
Tom Finegan
6397597194 vpxpes_parser: Fix MSVC build.
Replace implicit cast with explicit cast.

Change-Id: I6e8948e46b7589af334eaea3b41e0bcb808b7825
2016-04-08 21:23:12 -07:00
Tom Finegan
22b0845686 webmts: Fix implicit conversion warnings.
Fix warnings exposed by addition of -Wshorten-64-32 compiler flag
in webmts sources.

Change-Id: I3104e7be2bf991d7e108b652857ecca8e82c5ef9
2016-04-08 10:44:35 -07:00
Tom Finegan
2ff2954fa9 msvc/webm2pes: Silence integer and floating point conversion warnings.
Change-Id: I5379b5a3896b316327f35ebfaa3b2fc8545f002b
2016-03-31 10:43:10 -07:00
Tom Finegan
074456386e msvc/vpxpes_parser: Silence integer conversion warning.
Change-Id: I968693578f5596ebef6f576765a19f8210db5f4a
2016-03-31 10:32:37 -07:00
Tom Finegan
e6ed0f4817 msvc/vpxpes2ts: Fix MSVC integer conversion warning.
Change-Id: Ia2613f160b76f664cbdfeb314026f056f4be2fcc
2016-03-30 12:32:22 -07:00
Tom Finegan
cbe5c40d12 Restore original namespaces for mkvmuxer and mkvparser.
Wrapping mkvmuxer and mkvparser in the libwebm namespace is no
longer necessary now that the tree reorganization is complete.
Put mkvmuxer and mkvparser namespaces back in the global
namespace to avoid unnecessary churn in downstream code.

Change-Id: I13a4fe0143d20bb2bb6038078c68636ff2af0c29
2016-03-21 14:41:49 -07:00
Tom Finegan
504e0f2d5b Mass file extension update.
- Use .cc and .h everywhere.
- Update includes/include guards.
- Remove extra makefile targets necessitated by previous mix
  of cpp/cc.

Change-Id: I7aad29152d4177937f8f42927c16c6572228c104
2016-03-21 14:41:47 -07:00
Tom Finegan
008aa63d6a mkvparser: move to mkvparser sub dir.
Move mkvparser and mkvreader to mkvparser/.

Change-Id: I18c4575483f628344034d81b7d90d3aa86c163ff
2016-03-18 10:22:22 -07:00
clang-format
91ca780522 reapply clang-format
Change-Id: Ic04e8429b07fe9b7dc15dc836d16ba9f30317ee2
2016-03-16 12:18:08 -07:00
Tom Finegan
c5b76d8d11 Extract PES parser from WebM2Pes tests.
Change-Id: I6c81255635a65337bdb701119a3814801864469d
2016-03-11 14:12:57 -08:00
Tom Finegan
7015af5b08 iwyu/vpxpes2ts: Update includes.
Include what you use analysis based include update.

Change-Id: I6e7b296886c477107f8d50a7ed02187d01df125c
2016-03-10 09:21:48 -08:00
Tom Finegan
c1d6a70204 iwyu/webm2pes: Update includes.
Include what you use analysis based include update.

Change-Id: Ib390c6a669d31ec298a4db407a50904576b99d91
2016-03-10 09:21:48 -08:00
Tom Finegan
44e31fb4d9 iwyu/webm2pes_tests: Update includes.
Include what you use analysis based include update.

Change-Id: Iaef395051e24654933c278f63965491091775773
2016-03-10 09:21:48 -08:00
Tom Finegan
5f673caf7a iwyu/webm2pes_main: Update includes.
Include what you use analysis based include update.

Change-Id: I7fc997acd0839d9543438fca01000ebb37a45dbb
2016-03-10 09:21:48 -08:00
Tom Finegan
747244af1d iwyu/vpxpes2ts_main: Update includes.
Include what you use analysis based include update.

Change-Id: Ifa09162b0a6783e353e9cd494143c5118e22200d
2016-03-10 09:21:48 -08:00
Tom Finegan
1f74651b5b webmts: Move PES/TS sources to m2ts sub directory.
Change-Id: I5c02b62460a6bf8dd73fb9274d1668a5a13af373
2016-03-07 14:32:08 -08:00