Пример #1
0
int	dummy_stop(tmedia_t* self)
{
	dummy_t *dummy = DUMMY(self);
	TSK_DEBUG_INFO("dummy_stop");
	
	return 0;
}
Пример #2
0
int	dummy_pause(tmedia_t* self)
{
	dummy_t *dummy = DUMMY(self);
	TSK_DEBUG_INFO("dummy_pause");

	return 0;
}
Пример #3
0
int
nf2_dummy_write(struct netfpga *nf, void *ctx, uint32_t reg, void *buf, size_t buf_len)
{

	(void)nf;
	ASSERT(ctx != NULL);
	DUMMY("write request (reg %#x, to %p, length %d)", reg, buf, (int)buf_len);
	return (buf_len);
}
Пример #4
0
int
nf2_dummy_close(struct netfpga *nf, void *ctx)
{

	(void)nf;
	ASSERT(ctx != NULL);
	DUMMY();
	free(ctx);
	return (0);
}
Пример #5
0
const tsdp_header_M_t* dummy_get_local_offer(tmedia_t* self, va_list *app)
{
	dummy_t *dummy = DUMMY(self);
	const tsk_object_def_t* objdef;
	tsdp_header_t* header;

	TSK_DEBUG_INFO("dummy_get_local_offer");
	while((objdef = va_arg(*app, const tsk_object_def_t*))){
		header = tsk_object_new_2(objdef, app);

		TSK_OBJECT_SAFE_FREE(header);
	}
Пример #6
0
/*
 * Placeholders for NetFPGA Linux handling code
 */
void *
nf2_dummy_open(struct netfpga *nf)
{
	int *dummy;

	(void)nf;
	dummy = calloc(1, sizeof(*dummy));
	ASSERT(dummy != NULL);

	*dummy = 1;
	DUMMY();

	return (dummy);
}
Пример #7
0
void yyerror(void *dummy1, void *dummy2, const char *s) {
    DUMMY(dummy1);
    DUMMY(dummy2);
    throw CompilerException(s);
}
Пример #8
0
bool tsPacket::getNextPSI(uint32_t pid,TS_PSIpacketInfo *psi)
{
    int multiPacketPsi=0;
    int nbRetries=0;
    uint64_t startOffset=0;
    TSpacketInfo pkt;
nextPack2:
    if(nbRetries && pkt.startAt-startOffset>(1<<25)) // max. 32 MiB
    {
        ADM_warning("Giving up after %d retries, consumed %" PRId64" bytes\n",nbRetries,pkt.startAt-startOffset);
        return false;
    }
    if(false==getNextPacket_NoHeader(pid,&pkt,true)) return false;    
    if(!nbRetries)
        startOffset=pkt.startAt;
    nbRetries++;
    uint32_t tableId;
    uint32_t sectionLength=0;
    uint32_t transportStreamId=0;
    uint32_t dummy;
    
    getBits bits(pkt.payloadSize,pkt.payload);

    DUMMY(tableId,8);
    int section_syntax_indicator=bits.get(1);
#ifdef VERBOSE_PSI
    if(!section_syntax_indicator)
        ADM_warning("Syntax section indicator not set\n");
#endif
    if(bits.get(1)) // Private bit
    {
        ADM_warning("Section syntax is set to private\n");
        goto nextPack2;
    }
    bits.get(2); // 2 Reserved bits
    sectionLength=bits.get(12); // Section Length
#if 1
    if(sectionLength+3>pkt.payloadSize) 
    {
        if(!multiPacketPsi)
            ADM_warning("[MpegTs] Multi Packet PSI ? sectionLength=%d, len=%d\n",sectionLength,pkt.payloadSize);
        multiPacketPsi++;
        goto nextPack2;
    }
    if(multiPacketPsi>1)
        ADM_warning("Multi packet PSI warning repeated %d times\n",multiPacketPsi);
    multiPacketPsi=0;
#endif
    transportStreamId=bits.get(16);// transportStreamId
#ifdef VERBOSE_PSI
    printf("[MpegTs] Section length    =%d\n",sectionLength);
    printf("[MpegTs] transportStreamId =%d\n",transportStreamId);
#endif
    bits.skip(2);                  // ignored
    DUMMY(VersionNumber,5);         // Version number
    DUMMY(CurrentNext,1);           // Current Next indicator
    psi->count=bits.get(8);           // Section number
    psi->countMax=bits.get(8);        // Section last number
#ifdef VERBOSE_PSI
    printf("[MpegTs] Count=%d CountMax=%d\n",psi->count,psi->countMax);
#endif
    if(psi->count!=psi->countMax) return false; // we dont handle split psi at the moment

    uint8_t *c=pkt.payload+sectionLength-4+3;

// Verify CRC
    uint32_t crc1=mpegTsCRC(pkt.payload,sectionLength-4+3);
    uint32_t crc2=(c[0]<<24)+(c[1]<<16)+(c[2]<<8)+c[3];
    if(crc1!=crc2)
    {
        printf("[MpegTs] getNextPSI bad checksum :%04x vs %04x\n",crc1,crc2);
        goto nextPack2;
    }


    int hdr=(8+16+16+8+8+8)/8;
    int payloadsize=sectionLength-4-5; // Remove checksum & header
    if(payloadsize<4) goto nextPack2;
    psi->payloadSize=payloadsize;
    memcpy(psi->payload,pkt.payload+hdr,psi->payloadSize);
    return true;
}
static int android_write(void* cookie, const char* buf, int size) {
	DUMMY(cookie);
	DUMMY(buf);
	DUMMY(size);
	return EACCES; // can't provide write access to the apk
}
Пример #10
0
bool tsPacket::getNextPSI(uint32_t pid,TS_PSIpacketInfo *psi)
{
    TSpacketInfo pkt;
nextPack2:

    if(false==getNextPacket_NoHeader(pid,&pkt,true)) return false;    

    
    uint32_t tableId;
    uint32_t sectionLength=0;
    uint32_t transportStreamId=0;
    uint32_t dummy;
    
    getBits bits(pkt.payloadSize,pkt.payload);

    DUMMY(tableId,8);
    int section_syntax_indicator=bits.get(1);
    if(section_syntax_indicator)
        ADM_warning("Section Syntax is set to private\n");
    if(bits.get(1))             // Marker
    {
          printf("[MpegTs] getNextPSI Missing 0 marker\n");
          goto nextPack2;
    }
    bits.get(2);
    sectionLength=bits.get(12);    // Section Length
#if 1
    if(sectionLength+3>pkt.payloadSize) 
    {
        ADM_warning("[MpegTs] Multi Packet PSI ? sectionLength=%d, len=%d\n",sectionLength,pkt.payloadSize);
        goto nextPack2;
    }
#endif
    transportStreamId=bits.get(16);// transportStreamId
#ifdef VERBOSE_PSI
    printf("[MpegTs] Section length    =%d\n",sectionLength);
    printf("[MpegTs] transportStreamId =%d\n",transportStreamId);
#endif
    bits.skip(2);                  // ignored
    DUMMY(VersionNumber,5);         // Version number
    DUMMY(CurrentNext,1);           // Current Next indicator
    psi->count=bits.get(8);           // Section number
    psi->countMax=bits.get(8);        // Section last number
#ifdef VERBOSE_PSI
    printf("[MpegTs] Count=%d CountMax=%d\n",psi->count,psi->countMax);
#endif
    if(psi->count!=psi->countMax) return false; // we dont handle split psi at the moment

    uint8_t *c=pkt.payload+sectionLength-4+3;

// Verify CRC
    uint32_t crc1=mpegTsCRC(pkt.payload,sectionLength-4+3);
    uint32_t crc2=(c[0]<<24)+(c[1]<<16)+(c[2]<<8)+c[3];
    if(crc1!=crc2)
    {
        printf("[MpegTs] getNextPSI bad checksum :%04x vs %04x\n",crc1,crc2);
        goto nextPack2;
    }


    int hdr=(8+16+16+8+8+8)/8;
    int payloadsize=sectionLength-4-5; // Remove checksum & header
    if(payloadsize<4) goto nextPack2;
    psi->payloadSize=payloadsize;
    memcpy(psi->payload,pkt.payload+hdr,psi->payloadSize);
    return true;
}