2001-02-24 20:28:24 +00:00
|
|
|
/*
|
|
|
|
* video_out_pgm.c, pgm interface
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Hacked into mpeg2dec by
|
|
|
|
*
|
|
|
|
* Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
|
|
|
*
|
|
|
|
* 15 & 16 bpp support added by Franck Sicard <Franck.Sicard@solsoft.fr>
|
|
|
|
*
|
|
|
|
* Xv image suuport by Gerd Knorr <kraxel@goldbach.in-berlin.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "video_out.h"
|
|
|
|
#include "video_out_internal.h"
|
|
|
|
|
|
|
|
LIBVO_EXTERN (md5)
|
|
|
|
|
|
|
|
static vo_info_t vo_info =
|
|
|
|
{
|
|
|
|
"MD5 sum",
|
|
|
|
"md5",
|
|
|
|
"walken",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
|
|
|
|
extern vo_functions_t video_out_pgm;
|
2001-04-17 21:00:46 +00:00
|
|
|
extern char vo_pgm_filename[24];
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
static FILE * md5_file;
|
|
|
|
|
|
|
|
static uint32_t
|
2002-02-01 02:49:04 +00:00
|
|
|
config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info)
|
2001-02-24 20:28:24 +00:00
|
|
|
{
|
|
|
|
md5_file = fopen ("md5", "w");
|
2002-01-31 09:57:13 +00:00
|
|
|
return video_out_pgm.config (width, height, d_width,d_height,fullscreen, title, format,info);
|
2001-02-24 20:28:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const vo_info_t*
|
|
|
|
get_info(void)
|
|
|
|
{
|
|
|
|
return &vo_info;
|
|
|
|
}
|
|
|
|
|
2001-08-13 11:08:18 +00:00
|
|
|
static void draw_osd(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
static void flip_page (void)
|
|
|
|
{
|
|
|
|
char buf2[100];
|
|
|
|
FILE * f;
|
|
|
|
int i;
|
|
|
|
|
2001-04-17 21:00:46 +00:00
|
|
|
video_out_pgm.flip_page();
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2001-06-11 12:41:53 +00:00
|
|
|
snprintf (buf2, 100, "md5sum %s", vo_pgm_filename);
|
2001-02-24 20:28:24 +00:00
|
|
|
f = popen (buf2, "r");
|
|
|
|
i = fread (buf2, 1, sizeof(buf2), f);
|
|
|
|
pclose (f);
|
|
|
|
fwrite (buf2, 1, i, md5_file);
|
|
|
|
|
2001-04-17 21:00:46 +00:00
|
|
|
remove (vo_pgm_filename);
|
|
|
|
|
|
|
|
}
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2001-04-17 21:00:46 +00:00
|
|
|
//static uint32_t draw_slice(uint8_t * src[], uint32_t slice_num)
|
|
|
|
static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
|
|
|
|
{
|
|
|
|
return video_out_pgm.draw_slice(image,stride,w,h,x,y);
|
|
|
|
}
|
|
|
|
|
|
|
|
//extern uint32_t output_pgm_frame (char * fname, uint8_t * src[]);
|
|
|
|
|
|
|
|
static uint32_t draw_frame(uint8_t * src[])
|
|
|
|
{
|
2001-02-24 20:28:24 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint32_t
|
|
|
|
query_format(uint32_t format)
|
|
|
|
{
|
2001-04-17 21:00:46 +00:00
|
|
|
return video_out_pgm.query_format(format);
|
2001-02-24 20:28:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
uninit(void)
|
|
|
|
{
|
2001-04-17 21:00:46 +00:00
|
|
|
video_out_pgm.uninit();
|
|
|
|
fclose(md5_file);
|
2001-02-24 20:28:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-03-03 21:46:39 +00:00
|
|
|
static void check_events(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-01-26 16:01:26 +00:00
|
|
|
static uint32_t preinit(const char *arg)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2001-03-03 21:46:39 +00:00
|
|
|
|
2002-01-26 16:01:26 +00:00
|
|
|
static void query_vaa(vo_vaa_t *vaa)
|
|
|
|
{
|
|
|
|
memset(vaa,0,sizeof(vo_vaa_t));
|
|
|
|
}
|