/*************************************************************************** * Copyright (c) 2005-2009, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: mkbtpfile.c $ * $brcm_Revision: 3 $ * $brcm_Date: 7/13/09 10:26a $ * * Module Description: Transport Stream Index Player * * Revision History: * * $brcm_Log: /BSEAV/lib/bcmplayer/utils/mkbtpfile.c $ * * 3 7/13/09 10:26a erickson * PR56423: clarify eBpPlayDecoderGOPTrick, remove unused * eBpPlaySTCFastForward * * 2 4/30/07 1:10p erickson * PR30310: expanded supported playmodes * * Irvine_BSEAVSW_Devel/7 1/6/06 10:16a erickson * PR17108: updated for magnum basemodules and 64 bit cpus * * Irvine_BSEAVSW_Devel/6 8/9/05 2:33p erickson * PR16208: uclibc gets doesn't overwrite n with 0 * * Irvine_BSEAVSW_Devel/5 6/14/05 7:50a erickson * PR15861: added host trick mode support * * Irvine_BSEAVSW_Devel/4 3/17/05 9:52a erickson * PR13202: added speed and start location prompts * * Irvine_BSEAVSW_Devel/3 3/9/05 12:28p erickson * PR13202: added zeroByteCountEnd logic * ***********************************************************/ #include "bstd.h" #include "bkni.h" #include "bcmplayer.h" #include #include #include #include static struct { eBpPlayModeParam playMode; const char *name; } g_playModes[] = { {eBpPlayNormal, "normal"}, {eBpPlayNormalByFrames, "normalbyframes"}, {eBpPlayI, "i"}, {eBpPlaySkipB, "skipb"}, {eBpPlayIP, "ip"}, {eBpPlayBrcm, "brcm"}, {eBpPlayDecoderGOPTrick, "gop"}, }; static eBpPlayModeParam g_convert_playModeStr(const char *name) { unsigned i = 0; for (i=0;i BUFSIZE) n = BUFSIZE; if (fread(buf, 1, n, mpegfile) != (size_t)n) return -1; /* zero out unwanted data */ if (read+n >= (int)zero_at && bcmEntry.zeroByteCountEnd) { if (read > zero_at) { printf("zeroing %d, %d\n", read, n); memset(&buf[read], 0, n); } else { printf("zeroing %d, %d\n", zero_at-read, n-(zero_at-read)); memset(&buf[zero_at-read], 0, n - (zero_at-read)); } } fwrite(buf, 1, n, outfile); read += n; } } } fclose(mpegfile); fclose(indexfile); fclose(outfile); return 0; }