Ignore:
Timestamp:
02/28/14 15:04:07 (10 years ago)
Author:
obi
Message:

mipsel add minitv support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/sh4port.h

    r24767 r26547  
    741741}
    742742
     743int setvmpeg(struct dvbdev* node, int posx, int posy, int width, int height)
     744{
     745        if(status.tvpic == 1 && (posx != 0 || posy != 0 || width != 0 || height != 0))
     746                return 0;
     747
     748        if(getconfigint("minitv", NULL) == 1)
     749                return 0;
     750       
     751        char* vmpegdev = NULL, *tmpstr = NULL, *buf = NULL;
     752        int ret = 0;
     753
     754        if(node == NULL) return 1;
     755        vmpegdev = getconfig("vmpegalldev", NULL);
     756
     757        if(vmpegdev != NULL)
     758        {
     759                buf = malloc(MINMALLOC);
     760                if(buf == NULL)
     761                {
     762                        err("no mem");
     763                        return 1;
     764                }
     765               
     766                tmpstr = malloc(MINMALLOC);
     767                if(tmpstr == NULL)
     768                {
     769                        err("no mem");
     770                        free(buf);
     771                        return 1;
     772                }
     773               
     774                snprintf(buf, MINMALLOC, vmpegdev, node->devnr);
     775                snprintf(tmpstr, MINMALLOC, "%x %x %x %x", posx, posy, width, height);
     776                debug(100, "set %s to %s", buf, tmpstr);
     777
     778                status.tvpic = 1;
     779                ret = writesys(buf, tmpstr, 1);
     780
     781                //reset
     782                if(posx == 0 && posy == 0 && width == 0 && height == 0)
     783                        status.tvpic = 0;
     784               
     785                free(tmpstr);
     786                free(buf);
     787                return ret;
     788        }
     789
     790        return 0;
     791}
     792
     793//flag 0: wh = width
     794//flag 1: wh = height
     795int setvmpegrect(struct dvbdev* node, int posx, int posy, int wh, int flag)
     796{
     797        int ret = 0;
     798        int leftoffset = status.leftoffset;
     799        int rightoffset = status.rightoffset;
     800        int topoffset = status.topoffset;
     801        int bottomoffset = status.bottomoffset;
     802
     803        float rx = (float)fb->width / 720;
     804        float ry = (float)fb->height / 576;
     805
     806        leftoffset = (float)leftoffset / rx;
     807        rightoffset = (float)rightoffset / rx;
     808        topoffset = (float)topoffset / ry;
     809        bottomoffset = (float)bottomoffset / ry;
     810
     811        rx = (float)720 / (float)(720 - leftoffset - rightoffset);
     812        ry = (float)576 / (float)(576 - topoffset - bottomoffset);
     813
     814        posx = (float)posx / rx;
     815        posx += leftoffset;
     816
     817        posy = (float)posy / ry;
     818        posy += topoffset;
     819
     820        if(flag == 0)
     821        {
     822                wh = ((float)wh / rx);
     823                ret = setvmpeg(node, posx, posy, wh, (int)((float)wh / 1.2));
     824        }
     825
     826        if(flag == 1)
     827        {
     828                wh = ((float)wh / ry);
     829                ret = setvmpeg(node, posx, posy, (int)((float)wh * 1.2), wh);
     830        }
     831
     832        return ret;
     833}
     834
     835int resettvpic()
     836{
     837        int ret = 0;
     838
     839        if(status.tvpic > 0 && status.aktservice != NULL)
     840                ret = setvmpeg(status.aktservice->videodev, 0, 0, 0, 0);
     841
     842        return ret;
     843}
     844
    743845#endif
Note: See TracChangeset for help on using the changeset viewer.