Changeset 26547 for titan/titan/global.h


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/global.h

    r25939 r26547  
    32003200}
    32013201
    3202 int setvmpeg(struct dvbdev* node, int posx, int posy, int width, int height)
    3203 {
    3204         if(status.tvpic == 1 && (posx != 0 || posy != 0 || width != 0 || height != 0))
    3205                 return 0;
    3206 
    3207         if(getconfigint("minitv", NULL) == 1)
    3208                 return 0;
    3209        
    3210         char* vmpegdev = NULL, *tmpstr = NULL, *buf = NULL;
    3211         int ret = 0;
    3212 
    3213         if(node == NULL) return 1;
    3214         vmpegdev = getconfig("vmpegalldev", NULL);
    3215 
    3216         if(vmpegdev != NULL)
    3217         {
    3218                 buf = malloc(MINMALLOC);
    3219                 if(buf == NULL)
    3220                 {
    3221                         err("no mem");
    3222                         return 1;
    3223                 }
    3224                
    3225                 tmpstr = malloc(MINMALLOC);
    3226                 if(tmpstr == NULL)
    3227                 {
    3228                         err("no mem");
    3229                         free(buf);
    3230                         return 1;
    3231                 }
    3232                
    3233                 snprintf(buf, MINMALLOC, vmpegdev, node->devnr);
    3234                 snprintf(tmpstr, MINMALLOC, "%x %x %x %x", posx, posy, width, height);
    3235                 debug(100, "set %s to %s", buf, tmpstr);
    3236 
    3237                 status.tvpic = 1;
    3238                 ret = writesys(buf, tmpstr, 1);
    3239 
    3240                 //reset
    3241                 if(posx == 0 && posy == 0 && width == 0 && height == 0)
    3242                         status.tvpic = 0;
    3243                
    3244                 free(tmpstr);
    3245                 free(buf);
    3246                 return ret;
    3247         }
    3248 
    3249         return 0;
    3250 }
    3251 
    3252 //flag 0: wh = width
    3253 //flag 1: wh = height
    3254 int setvmpegrect(struct dvbdev* node, int posx, int posy, int wh, int flag)
    3255 {
    3256         int ret = 0;
    3257         int leftoffset = status.leftoffset;
    3258         int rightoffset = status.rightoffset;
    3259         int topoffset = status.topoffset;
    3260         int bottomoffset = status.bottomoffset;
    3261 
    3262         float rx = (float)fb->width / 720;
    3263         float ry = (float)fb->height / 576;
    3264 
    3265         leftoffset = (float)leftoffset / rx;
    3266         rightoffset = (float)rightoffset / rx;
    3267         topoffset = (float)topoffset / ry;
    3268         bottomoffset = (float)bottomoffset / ry;
    3269 
    3270         rx = (float)720 / (float)(720 - leftoffset - rightoffset);
    3271         ry = (float)576 / (float)(576 - topoffset - bottomoffset);
    3272 
    3273         posx = (float)posx / rx;
    3274         posx += leftoffset;
    3275 
    3276         posy = (float)posy / ry;
    3277         posy += topoffset;
    3278 
    3279         if(flag == 0)
    3280         {
    3281                 wh = ((float)wh / rx);
    3282                 ret = setvmpeg(node, posx, posy, wh, (int)((float)wh / 1.2));
    3283         }
    3284 
    3285         if(flag == 1)
    3286         {
    3287                 wh = ((float)wh / ry);
    3288                 ret = setvmpeg(node, posx, posy, (int)((float)wh * 1.2), wh);
    3289         }
    3290 
    3291         return ret;
    3292 }
    3293 
    3294 int resettvpic()
    3295 {
    3296         int ret = 0;
    3297 
    3298         if(status.tvpic > 0 && status.aktservice != NULL)
    3299                 ret = setvmpeg(status.aktservice->videodev, 0, 0, 0, 0);
    3300 
    3301         return ret;
    3302 }
    3303 
    33043202/*
    33053203int checkdev(char* dev)
Note: See TracChangeset for help on using the changeset viewer.