Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -Nuar mplayer-export-2012-05-05//configure mplayer-clean-st2205u//configure
- --- mplayer-export-2012-05-05//configure 2012-04-29 23:54:20.000000000 +0800
- +++ mplayer-clean-st2205u//configure 2012-05-05 22:10:51.225913032 +0800
- @@ -873,6 +873,7 @@
- def_priority="#undef CONFIG_PRIORITY"
- def_pthread_cache="#undef PTHREAD_CACHE"
- shmem=no
- +_st2205u=auto
- for ac_option do
- case "$ac_option" in
- --help|-help|-h)
- @@ -4341,6 +4342,28 @@
- fi
- echores "$_xv"
- +echocheck "st2205u"
- +if test "$_st2205u" = auto ; then
- + cat > $TMPC <<EOF
- +#include <st2205.h>
- +int main(void) {
- + (void) st2205_open("");
- + return 0; }
- +EOF
- + _st2205u=no
- + cc_check -lst2205 && _st2205u=yes
- +fi
- +
- +if test "$_st2205u" = yes ; then
- + def_xv='#define CONFIG_ST2205U 1'
- + libs_mplayer="$libs_mplayer -lst2205"
- + vomodules="st2205u $vomodules"
- +else
- + def_xv='#undef CONFIG_ST2205U'
- + novomodules="st2205u $_novomodules"
- +fi
- +echores "$_st2205u"
- +
- echocheck "XvMC"
- if test "$_xvmc" != no && test "$_xv" = yes ; then
- @@ -8123,6 +8146,7 @@
- S3FB = $_s3fb
- SDL = $_sdl
- SPEEX = $_speex
- +ST2205U = $_st2205u
- STREAM_CACHE = $_stream_cache
- SGIAUDIO = $_sgiaudio
- SUNAUDIO = $_sunaudio
- diff -Nuar mplayer-export-2012-05-05//libvo/vo_st2205u.c mplayer-clean-st2205u//libvo/vo_st2205u.c
- --- mplayer-export-2012-05-05//libvo/vo_st2205u.c 1970-01-01 07:30:00.000000000 +0730
- +++ mplayer-clean-st2205u//libvo/vo_st2205u.c 2012-05-05 22:11:14.545322227 +0800
- @@ -0,0 +1,158 @@
- +/*
- + * Video driver for ST2205U
- + * Copyright 2008 Sprite_tm <picframe@spritesmods.com>
- + * For more info, please visit http://spritesmods.com/?art=picframe
- + */
- +
- +#include <stdio.h>
- +#include <stdlib.h>
- +#include <string.h>
- +#include <unistd.h>
- +#include <errno.h>
- +
- +#include <sys/mman.h>
- +#include <sys/ioctl.h>
- +#include <linux/fb.h>
- +
- +#include "config.h"
- +#include "video_out.h"
- +#include "video_out_internal.h"
- +#include "fastmemcpy.h"
- +#include "sub/sub.h"
- +#include "mp_msg.h"
- +
- +#include <st2205.h>
- +
- +
- +static vo_info_t info = {
- + "st2205u device",
- + "st2205u",
- + "Jeroen Domburg <picframe@spritesmods.com>",
- + ""
- +};
- +
- +LIBVO_EXTERN(st2205u)
- +
- +static char *st_dev_name = NULL; // such as /dev/sda
- +static st2205_handle *st_h; // handle for st_dev_name
- +static char *st_imagebuff;
- +
- +static int st_preinit(int reset)
- +{
- + static int st_preinit_done = 0;
- + static int st_err = -1;
- +
- + if (reset) {
- + st_preinit_done = 0;
- + return 0;
- + }
- +
- + if (st_preinit_done)
- + return st_err;
- +
- + st_preinit_done = 1;
- + printf("st2205: preinit\n");
- + if (!st_dev_name)
- + st_dev_name = strdup("/dev/sda");
- +
- + mp_msg(MSGT_VO, MSGL_V, "[st2205u] Using device %s\n", st_dev_name);
- +
- + st_h=st2205_open(st_dev_name);
- + if (st_h==NULL) {
- + mp_msg(MSGT_VO, MSGL_ERR, "[st2205u] Can't open %s: %s\n", st_dev_name, strerror(errno));
- + goto err_out;
- + }
- + st_imagebuff=malloc(st_h->height*st_h->width*3);
- + st_err = 0;
- + printf("[st2205u] %s opened successfully.\n", st_dev_name);
- + return 0;
- +err_out:
- + st_err = -1;
- + return -1;
- +}
- +
- +static int preinit(const char *subdevice)
- +{
- + if (subdevice)
- + {
- + if (st_dev_name) free(st_dev_name);
- + st_dev_name = strdup(subdevice);
- + }
- + return st_preinit(0);
- +}
- +
- +static void draw_osd(void) {
- + return;
- +}
- +
- +static int config(uint32_t width, uint32_t height, uint32_t d_width,
- + uint32_t d_height, uint32_t flags, char *title,
- + uint32_t format)
- +{
- + return 0;
- +}
- +
- +static int query_format(uint32_t format)
- +{
- + if (st_preinit(0)) return 0;
- + if ((format & IMGFMT_RGB_MASK) == IMGFMT_RGB) {
- + if ((format & 0xff)==24) return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_ACCEPT_STRIDE;
- + }
- + return 0;
- +}
- +
- +
- +// all csp support stride
- +static int draw_frame(uint8_t *src[]) { return 1; }
- +
- +static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y)
- +{
- + char *imagebuff;
- + uint8_t *in = src[0];
- + uint8_t *dest = st_imagebuff + (st_h->width * y + x) * 3;
- + int next = st_h->width * 3;
- + int i,j;
- +
- + //make sure we won't cross the boundaries of dest
- + if (x>127) return 0;
- + if (y>127) return 0;
- + if (w+x>st_h->width) w=st_h->width-x;
- + if (h+x>st_h->height) h=st_h->height-x;
- +
- + for (i = 0; i < h; i++) {
- + //manually do a memcpy because the bytes
- + //should be flipped first :X
- + for (j=0; j<w; j++) {
- + dest[j*3]=in[j*3];
- + dest[j*3+1]=in[j*3+1];
- + dest[j*3+2]=in[j*3+2];
- + }
- + dest += next;
- + in += stride[0];
- + }
- + return 0;
- +}
- +
- +static void check_events(void)
- +{
- +}
- +
- +static void flip_page(void)
- +{
- + //write dest to device
- + st2205_send_data(st_h,st_imagebuff);
- +}
- +
- +static void uninit(void)
- +{
- + st_preinit(1); // so that later calls to preinit don't fail
- +}
- +
- +static int control(uint32_t request, void *data)
- +{
- + switch (request) {
- + case VOCTRL_QUERY_FORMAT:
- + return query_format(*((uint32_t*)data));
- + }
- + return VO_NOTIMPL;
- +}
- diff -Nuar mplayer-export-2012-05-05//Makefile mplayer-clean-st2205u//Makefile
- --- mplayer-export-2012-05-05//Makefile 2012-04-01 05:03:45.000000000 +0800
- +++ mplayer-clean-st2205u//Makefile 2012-05-05 22:10:54.977818110 +0800
- @@ -592,6 +592,7 @@
- SRCS_MPLAYER-$(S3FB) += libvo/vo_s3fb.c
- SRCS_MPLAYER-$(SDL) += libao2/ao_sdl.c libvo/vo_sdl.c libvo/sdl_common.c
- SRCS_MPLAYER-$(SGIAUDIO) += libao2/ao_sgi.c
- +SRCS_MPLAYER-$(ST2205U) += libvo/vo_st2205u.c
- SRCS_MPLAYER-$(SUNAUDIO) += libao2/ao_sun.c
- SRCS_MPLAYER-$(SVGA) += libvo/vo_svga.c
- SRCS_MPLAYER-$(TDFXFB) += libvo/vo_tdfxfb.c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement