comparison vidix/unichrome_vid.c @ 37107:3c5c93a30fb7

vidix: Replace printf with mp_msg - Make MPlayer more quiet when requested (e.g. when using -really-quiet) - Additionally change some minor capitalization and "bla:" to "[bla]" Patch-by: Arne Bochem >arneb.mp ccan de< Patch-also-OKed-by: Reimar
author al
date Sat, 17 May 2014 01:38:00 +0000
parents 598ef7d90b78
children
comparison
equal deleted inserted replaced
37106:1b9907dfe2f4 37107:3c5c93a30fb7
34 #include "vidix.h" 34 #include "vidix.h"
35 #include "fourcc.h" 35 #include "fourcc.h"
36 #include "dha.h" 36 #include "dha.h"
37 #include "pci_ids.h" 37 #include "pci_ids.h"
38 #include "pci_names.h" 38 #include "pci_names.h"
39 #include "mp_msg.h"
39 40
40 #include "unichrome_regs.h" 41 #include "unichrome_regs.h"
41 42
42 /** 43 /**
43 * @brief Information on PCI device. 44 * @brief Information on PCI device.
296 break; 297 break;
297 case IMGFMT_BGR32: 298 case IMGFMT_BGR32:
298 fetch = (ALIGN_TO (sw << 2, 16) >> 4) + 1; 299 fetch = (ALIGN_TO (sw << 2, 16) >> 4) + 1;
299 break; 300 break;
300 default: 301 default:
301 printf ("[unichrome] Unexpected pixelformat!"); 302 mp_msg(MSGT_VO, MSGL_STATUS, "[unichrome] Unexpected pixelformat!");
302 break; 303 break;
303 } 304 }
304 305
305 if (fetch < 4) 306 if (fetch < 4)
306 fetch = 4; 307 fetch = 4;
336 case IMGFMT_BGR16: 337 case IMGFMT_BGR16:
337 return V1_RGB16; 338 return V1_RGB16;
338 case IMGFMT_BGR32: 339 case IMGFMT_BGR32:
339 return V1_RGB32; 340 return V1_RGB32;
340 default: 341 default:
341 printf ("[unichrome] Unexpected pixelformat!"); 342 mp_msg(MSGT_VO, MSGL_STATUS, "[unichrome] Unexpected pixelformat!");
342 return V1_YUV422; 343 return V1_YUV422;
343 } 344 }
344 } 345 }
345 346
346 /** 347 /**
462 unsigned i, num_pci; 463 unsigned i, num_pci;
463 int err; 464 int err;
464 err = pci_scan (lst, &num_pci); 465 err = pci_scan (lst, &num_pci);
465 if (err) 466 if (err)
466 { 467 {
467 printf ("[unichrome] Error occurred during pci scan: %s\n", 468 mp_msg(MSGT_VO, MSGL_STATUS, "[unichrome] Error occurred during pci scan: %s\n",
468 strerror (err)); 469 strerror (err));
469 return err; 470 return err;
470 } 471 }
471 else 472 else
472 { 473 {
480 idx = find_chip (lst[i].device); 481 idx = find_chip (lst[i].device);
481 if (idx == -1) 482 if (idx == -1)
482 continue; 483 continue;
483 dname = pci_device_name (VENDOR_VIA2, lst[i].device); 484 dname = pci_device_name (VENDOR_VIA2, lst[i].device);
484 dname = dname ? dname : "Unknown chip"; 485 dname = dname ? dname : "Unknown chip";
485 printf ("[unichrome] Found chip: %s\n", dname); 486 mp_msg(MSGT_VO, MSGL_STATUS, "[unichrome] Found chip: %s\n", dname);
486 if ((lst[i].command & PCI_COMMAND_IO) == 0) 487 if ((lst[i].command & PCI_COMMAND_IO) == 0)
487 { 488 {
488 printf ("[unichrome] Device is disabled, ignoring\n"); 489 mp_msg(MSGT_VO, MSGL_STATUS, "[unichrome] Device is disabled, ignoring\n");
489 continue; 490 continue;
490 } 491 }
491 uc_cap.device_id = lst[i].device; 492 uc_cap.device_id = lst[i].device;
492 err = 0; 493 err = 0;
493 memcpy (&pci_info, &lst[i], sizeof (pciinfo_t)); 494 memcpy (&pci_info, &lst[i], sizeof (pciinfo_t));
495 } 496 }
496 } 497 }
497 } 498 }
498 499
499 if (err && verbose) 500 if (err && verbose)
500 printf ("[unichrome] Can't find chip\n"); 501 mp_msg(MSGT_VO, MSGL_STATUS, "[unichrome] Can't find chip\n");
501 return err; 502 return err;
502 } 503 }
503 504
504 /** 505 /**
505 * @brief Initializes driver. 506 * @brief Initializes driver.
808 break; 809 break;
809 } 810 }
810 if ((src_w > 4096) || (src_h > 4096) || 811 if ((src_w > 4096) || (src_h > 4096) ||
811 (src_w < 32) || (src_h < 1) || (pitch > 0x1fff)) 812 (src_w < 32) || (src_h < 1) || (pitch > 0x1fff))
812 { 813 {
813 printf ("[unichrome] Layer size out of bounds\n"); 814 mp_msg(MSGT_VO, MSGL_STATUS, "[unichrome] Layer size out of bounds\n");
814 } 815 }
815 816
816 /* Calculate offsets */ 817 /* Calculate offsets */
817 info->offset.y = 0; 818 info->offset.y = 0;
818 info->offset.v = info->offset.y + pitch * src_h; 819 info->offset.v = info->offset.y + pitch * src_h;