~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libmpcodecs/ve_vfw.c

  • Committer: Reinhard Tartler
  • Date: 2006-07-08 08:47:54 UTC
  • Revision ID: siretart@tauware.de-20060708084754-c3ff228cc9c2d8de
upgrade to pre8

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#ifdef USE_WIN32DLL
9
9
 
10
10
#include "mp_msg.h"
 
11
#include "help_mp.h"
11
12
 
12
13
#include "codec-cfg.h"
13
14
//#include "stream.h"
66
67
    mp_msg(MSGT_WIN32,MSGL_ERR,"ICOpen failed! unknown codec / wrong parameters?\n");
67
68
    return NULL;
68
69
  }
69
 
  printf("HIC: %x\n", encoder_hic);
 
70
  mp_msg(MSGT_WIN32,MSGL_INFO,"HIC: %x\n", encoder_hic);
70
71
 
71
72
#if 1
72
73
{
73
74
  ICINFO icinfo;
74
75
 
75
76
  ret = ICGetInfo(encoder_hic, &icinfo, sizeof(ICINFO));
76
 
  printf("%ld - %ld - %d\n", ret, icinfo.dwSize, sizeof(ICINFO));
77
 
printf("Compressor type: %.4lx\n", icinfo.fccType);
78
 
printf("Compressor subtype: %.4lx\n", icinfo.fccHandler);
79
 
printf("Compressor flags: %lu, version %lu, ICM version: %lu\n",
 
77
  mp_msg(MSGT_WIN32,MSGL_INFO,"%ld - %ld - %d\n", ret, icinfo.dwSize, sizeof(ICINFO));
 
78
  mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_CompressorType, icinfo.fccType);
 
79
  mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_CompressorSubtype, icinfo.fccHandler);
 
80
  mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_CompressorFlags,
80
81
    icinfo.dwFlags, icinfo.dwVersion, icinfo.dwVersionICM);
81
82
//printf("Compressor name: %s\n", icinfo.szName);
82
83
//printf("Compressor description: %s\n", icinfo.szDescription);
83
84
 
84
 
printf("Flags:");
 
85
mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_Flags);
85
86
if (icinfo.dwFlags & VIDCF_QUALITY)
86
 
    printf(" quality");
 
87
    mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_Quality);
87
88
if (icinfo.dwFlags & VIDCF_FASTTEMPORALD)
88
 
    printf(" fast-decompr");
 
89
    mp_msg(MSGT_WIN32,MSGL_INFO," fast-decompr");
89
90
if (icinfo.dwFlags & VIDCF_QUALITYTIME)
90
 
    printf(" temp-quality");
91
 
printf("\n");
 
91
    mp_msg(MSGT_WIN32,MSGL_INFO," temp-quality");
 
92
mp_msg(MSGT_WIN32,MSGL_INFO,"\n");
92
93
}
93
94
#endif
94
95
 
95
96
  temp_len = ICCompressGetFormatSize(encoder_hic, input_bih);
96
 
  printf("ICCompressGetFormatSize ret: %d\n", temp_len);
 
97
  mp_msg(MSGT_WIN32,MSGL_INFO,"ICCompressGetFormatSize ret: %d\n", temp_len);
97
98
 
98
99
  if (temp_len < sizeof(BITMAPINFOHEADER)) temp_len=sizeof(BITMAPINFOHEADER);
99
100
 
126
127
    for(i=sizeof(output_bih);i<temp_len;i++) mp_msg(MSGT_WIN32, MSGL_DBG2, "%02X ",temp[i]);
127
128
  }
128
129
 
129
 
//  if(verbose) {
 
130
//  if( mp_msg_test(MSGT_WIN32,MSGL_V) ) {
130
131
    printf("Starting compression:\n");
131
132
    printf(" Input format:\n");
132
133
        printf("  biSize %d\n", input_bih->biSize);
161
162
    mp_msg(MSGT_WIN32,MSGL_ERR,"ICCompressBegin failed: Error %d\n", (int)ret);
162
163
//    return 0;
163
164
  } else
164
 
  mp_msg(MSGT_WIN32,MSGL_V,"ICCompressBegin OK\n");
165
 
 
166
 
    printf(" Output format after query/begin:\n");
167
 
        printf("  biSize %d\n", output_bih->biSize);
168
 
        printf("  biWidth %d\n", output_bih->biWidth);
169
 
        printf("  biHeight %d\n", output_bih->biHeight);
170
 
        printf("  biPlanes %d\n", output_bih->biPlanes);
171
 
        printf("  biBitCount %d\n", output_bih->biBitCount);
172
 
        printf("  biCompression 0x%x ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression);
173
 
        printf("  biSizeImage %d\n", output_bih->biSizeImage);
 
165
    mp_msg(MSGT_WIN32,MSGL_V,"ICCompressBegin OK\n");
 
166
    mp_msg(MSGT_WIN32,MSGL_INFO," Output format after query/begin:\n");
 
167
    mp_msg(MSGT_WIN32,MSGL_INFO,"  biSize %d\n", output_bih->biSize);
 
168
    mp_msg(MSGT_WIN32,MSGL_INFO,"  biWidth %d\n", output_bih->biWidth);
 
169
    mp_msg(MSGT_WIN32,MSGL_INFO,"  biHeight %d\n", output_bih->biHeight);
 
170
    mp_msg(MSGT_WIN32,MSGL_INFO,"  biPlanes %d\n", output_bih->biPlanes);
 
171
    mp_msg(MSGT_WIN32,MSGL_INFO,"  biBitCount %d\n", output_bih->biBitCount);
 
172
    mp_msg(MSGT_WIN32,MSGL_INFO,"  biCompression 0x%x ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression);
 
173
    mp_msg(MSGT_WIN32,MSGL_INFO,"  biSizeImage %d\n", output_bih->biSizeImage);
174
174
  
175
175
  encoder_buf_size=input_bih->biSizeImage;
176
176
  encoder_buf=malloc(encoder_buf_size);
238
238
    return 0;
239
239
}
240
240
 
241
 
static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
 
241
static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
242
242
    long flags=0;
243
243
    int ret;
244
244
//    flip_upside_down(vo_image_ptr,vo_image_ptr,3*vo_w,vo_h); // dirty hack
245
245
    ret=vfw_encode_frame(mux_v->bih, mux_v->buffer, vfw_bih, mpi->planes[0], &flags, 10000);
246
 
    muxer_write_chunk(mux_v,mux_v->bih->biSizeImage,flags);
 
246
    muxer_write_chunk(mux_v,mux_v->bih->biSizeImage,flags, pts, pts);
247
247
    return 1;
248
248
}
249
249
 
270
270
 
271
271
    if (!vfw_param_codec)
272
272
    {
273
 
        printf("No VfW codec specified! It's required!\n");
 
273
        mp_msg(MSGT_WIN32,MSGL_WARN, MSGTR_MPCODECS_NoVfwCodecSpecified);
274
274
        return 0;
275
275
    }
276
276
//    mux_v->bih=vfw_open_encoder("divxc32.dll",vfw_bih,mmioFOURCC('D', 'I', 'V', '3'));