comparison dvcore.c @ 241:3d92f793fd67 libavformat

64 bit pts for writing - more const usage
author bellard
date Wed, 10 Sep 2003 22:37:33 +0000
parents 23a6daaa93dd
children 86232f9cd4f0
comparison
equal deleted inserted replaced
240:e6f99d238179 241:3d92f793fd67
416 10 bytes Cb 8x8 data */ 416 10 bytes Cb 8x8 data */
417 } 417 }
418 } 418 }
419 } 419 }
420 420
421 void dv_inject_audio(DVMuxContext *c, uint8_t* pcm, uint8_t* frame_ptr) 421 void dv_inject_audio(DVMuxContext *c, const uint8_t* pcm, uint8_t* frame_ptr)
422 { 422 {
423 int i, j, d, of; 423 int i, j, d, of;
424 for (i = 0; i < c->sys->difseg_size; i++) { 424 for (i = 0; i < c->sys->difseg_size; i++) {
425 frame_ptr += 6 * 80; /* skip DIF segment header */ 425 frame_ptr += 6 * 80; /* skip DIF segment header */
426 for (j = 0; j < 9; j++) { 426 for (j = 0; j < 9; j++) {
432 frame_ptr += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */ 432 frame_ptr += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
433 } 433 }
434 } 434 }
435 } 435 }
436 436
437 void dv_inject_video(DVMuxContext *c, uint8_t* video_data, uint8_t* frame_ptr) 437 void dv_inject_video(DVMuxContext *c, const uint8_t* video_data, uint8_t* frame_ptr)
438 { 438 {
439 int i, j; 439 int i, j;
440 int ptr = 0; 440 int ptr = 0;
441 441
442 for (i = 0; i < c->sys->difseg_size; i++) { 442 for (i = 0; i < c->sys->difseg_size; i++) {
563 out: 563 out:
564 return size; 564 return size;
565 } 565 }
566 566
567 /* FIXME: The following three functions could be underengineered ;-) */ 567 /* FIXME: The following three functions could be underengineered ;-) */
568 void dv_assemble_frame(DVMuxContext *c, uint8_t* video, uint8_t* audio, int asize) 568 void dv_assemble_frame(DVMuxContext *c, const uint8_t* video, const uint8_t* audio, int asize)
569 { 569 {
570 uint8_t pcm[8192]; 570 uint8_t pcm[8192];
571 uint8_t* frame = &c->frame_buf[0]; 571 uint8_t* frame = &c->frame_buf[0];
572 int fsize, reqasize; 572 int fsize, reqasize;
573 573
602 } 602 }
603 603
604 /* FIXME: we have to have more sensible approach than this one */ 604 /* FIXME: we have to have more sensible approach than this one */
605 if (fifo_size(&c->audio_data, c->audio_data.rptr) + asize >= AVCODEC_MAX_AUDIO_FRAME_SIZE) 605 if (fifo_size(&c->audio_data, c->audio_data.rptr) + asize >= AVCODEC_MAX_AUDIO_FRAME_SIZE)
606 fprintf(stderr, "Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->frames); 606 fprintf(stderr, "Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->frames);
607 fifo_write(&c->audio_data, audio, asize, &c->audio_data.wptr); 607 fifo_write(&c->audio_data, (uint8_t *)audio, asize, &c->audio_data.wptr);
608 } 608 }
609 } 609 }
610 610
611 int dv_core_init(DVMuxContext *c, AVStream *streams[]) 611 int dv_core_init(DVMuxContext *c, AVStream *streams[])
612 { 612 {