本文整理汇总了C++中Bounds::getFirst方法的典型用法代码示例。如果您正苦于以下问题:C++ Bounds::getFirst方法的具体用法?C++ Bounds::getFirst怎么用?C++ Bounds::getFirst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bounds
的用法示例。
在下文中一共展示了Bounds::getFirst方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// FIXME: maybe mmap isn't such a good idea for giant files?
int main(int argc, char *argv[])
{
int i, out, count;
MPEG2Parser *mpeg2parser;
// check for our arguments
#ifdef WRITEOUT
if (argc < 3)
{
fprintf(stderr, _("Usage: %s INPUT OUTPUT\n"), argv[0]);
exit(1);
}
#else // WRITEOUT
if (argc < 2)
{
fprintf(stderr, _("Usage: %s INPUT\n"), argv[0]);
exit(1);
}
#endif // WRITEOUT
decode_init();
mpeg2parser = new MPEG2Parser();
if (!mpeg2parser->init(argv[1], ticker))
{
fprintf(stderr, "%s\n", mpeg2parser->getError());
exit(1);
}
mpeg2parser->parse();
if (mpeg2parser->getError())
fprintf(stderr, "%s\n", mpeg2parser->getError());
#ifdef WRITEOUT
// open our output file for writing
if ((out = open(argv[2], O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) < 0)
{
perror(argv[2]);
exit(1);
}
#endif // WRITEOUT
List *GOPs = mpeg2parser->getGOPs();
printf(_("GOPs: %d\n"), GOPs->getNum());
#ifdef RENDEROUT
int GOPmax = GOPs->getNum();
for (i = 0; i < GOPmax; i++)
{
Pack *packet;
GroupOfPictures *GOP;
Bounds *bounds;
ElementStream *ves;
int start, stop;
int ves_start, ves_stop;
uint8_t *loc;
size_t len;
ticker(_("Rendering GOPs"), (float) ((float) i / (float) GOPmax));
GOP = (GroupOfPictures *) GOPs->vector(i);
bounds = GOP->getPacketBounds();
start = bounds->getFirst();
stop = bounds->getMax();
for (int j = start; j < stop; j++)
{
if (!(packet = (Pack *) mpeg2parser->getPackets()->vector(j)))
{
printf("%s", _("NULL packet?!\n"));
exit(1);
}
ves_start = packet->getVideoFirst();
ves_stop = packet->getVideoMax();
#ifdef WRITEOUT
/* write packets to disk */
if (loc =
mpeg2parser->bytesAvail(packet->getStart(), packet->getLen()))
{
write(out, loc, packet->getLen());
}
else
printf("%s", _("NULL vector area?!\n"));
#endif // WRITEOUT
for (int k = ves_start; k < ves_stop; k++)
{
if (!
(ves =
(ElementStream *) mpeg2parser->getVideo()->vector(k)))
//.........这里部分代码省略.........