Esempio n. 1
0
int mpeg_remux (int inp, int out)
{
  int          r;
  mpeg_demux_t *mpeg;

  mpeg = mpegd_open_fd (NULL, inp, 0);
  if (mpeg == NULL) {
    return (1);
  }

  mpeg->ext = out;
  mpeg->mpeg_system_header = &mpeg_remux_system_header;
  mpeg->mpeg_pack = &mpeg_remux_pack;
  mpeg->mpeg_packet = &mpeg_remux_packet;
  mpeg->mpeg_packet_check = &mpeg_packet_check;
  mpeg->mpeg_end = &mpeg_remux_end;

  mpeg_buf_init (&shdr);
  mpeg_buf_init (&pack);
  mpeg_buf_init (&packet);

  r = mpegd_parse (mpeg);

  mpegd_close (mpeg);

  mpeg_buf_free (&shdr);
  mpeg_buf_free (&pack);
  mpeg_buf_free (&packet);

  return (r);
}
Esempio n. 2
0
int mpeg_scan (FILE *inp, FILE *out)
{
	int          r;
	unsigned     i;
	mpeg_demux_t *mpeg;

	for (i = 0; i < 256; i++) {
		pts1[i] = ~(uint64_t) 0;
		pts2[i] = ~(uint64_t) 0;
	}

	mpeg = mpegd_open_fp (NULL, inp, 0);
	if (mpeg == NULL) {
		return (1);
	}

	mpeg->ext = out;

	mpeg->mpeg_system_header = &mpeg_scan_system_header;
	mpeg->mpeg_pack = &mpeg_scan_pack;
	mpeg->mpeg_packet = &mpeg_scan_packet;
	mpeg->mpeg_packet_check = &mpeg_packet_check;
	mpeg->mpeg_end = &mpeg_scan_end;

	r = mpegd_parse (mpeg);

	mpeg_print_stats (mpeg, out);

	mpegd_close (mpeg);

	return (r);
}
Esempio n. 3
0
int mpeg_list (FILE *inp, FILE *out)
{
	int          r;
	mpeg_demux_t *mpeg;

	mpeg = mpegd_open_fp (NULL, inp, 0);
	if (mpeg == NULL) {
		return (1);
	}

	skip_cnt = 0;
	skip_ofs = 0;

	mpeg->ext = out;

	mpeg->mpeg_skip = &mpeg_list_skip;
	mpeg->mpeg_system_header = &mpeg_list_system_header;
	mpeg->mpeg_pack = &mpeg_list_pack;
	mpeg->mpeg_packet = &mpeg_list_packet;
	mpeg->mpeg_packet_check = &mpeg_packet_check;
	mpeg->mpeg_end = &mpeg_list_end;

	r = mpegd_parse (mpeg);

	mpeg_list_print_skip (out);

	mpeg_print_stats (mpeg, out);

	mpegd_close (mpeg);

	return (r);
}