Search in sources :

Example 1 with MpegTsDecoder

use of org.codice.alliance.libs.mpegts.MpegTsDecoder in project alliance by codice.

the class MTSPacketToPESPacketDecoderTest method testDecode.

/**
 * This test sends MTSPackets to the decoder so that the decoder outputs one video pes packet.
 *
 * @throws Exception
 */
@Test
public void testDecode() throws Exception {
    MpegTsDecoder mpegTsDecoder = mock(MpegTsDecoder.class);
    MTSPacketToPESPacketDecoder decoder = new MTSPacketToPESPacketDecoder(mpegTsDecoder);
    MTSPacket mtsPacket = mock(MTSPacket.class);
    EmbeddedChannel channel = new EmbeddedChannel(decoder);
    channel.writeInbound(mtsPacket);
    NettyUtility.read(channel);
    verify(mpegTsDecoder).read(eq(mtsPacket), anyObject());
}
Also used : MTSPacket(org.taktik.mpegts.MTSPacket) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) MpegTsDecoder(org.codice.alliance.libs.mpegts.MpegTsDecoder) Test(org.junit.Test)

Aggregations

EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)1 MpegTsDecoder (org.codice.alliance.libs.mpegts.MpegTsDecoder)1 Test (org.junit.Test)1 MTSPacket (org.taktik.mpegts.MTSPacket)1