aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2005-03-30 03:43:12 +0000
committervektor <devnull@localhost>2005-03-30 03:43:12 +0000
commit3ff2448dc2b957884d4a72cd3cd777fb933279a4 (patch)
tree54162441db86bbcd43b2ae805ab7e7494f082be4
parenta09346558dec6504148ec13ba242b666ddb58f8f (diff)
* tvtime/src/tvtimeosd.c: Remove the code for the "backdrop", which was
something we added but never used. * tvtime/src/osdtools.h: No more need for osd_graphic_t. * tvtime/src/osdtools.c: Ditch the osd_graphic implementation.
-rw-r--r--src/osdtools.c146
-rw-r--r--src/osdtools.h16
-rw-r--r--src/tvtimeosd.c22
3 files changed, 0 insertions, 184 deletions
diff --git a/src/osdtools.c b/src/osdtools.c
index 0026974..4d0fcad 100644
--- a/src/osdtools.c
+++ b/src/osdtools.c
@@ -376,18 +376,6 @@ void osd_string_composite_packed422_scanline( osd_string_t *osds,
}
}
-/* Graphic functions */
-struct osd_graphic_s
-{
- uint8_t *image4444;
- int image_width;
- int image_height;
- int frames_left;
- int alpha;
- int hold;
- int *active;
-};
-
static int load_png_to_packed4444( uint8_t *buffer, int *active,
int width, int height, int stride,
double pixel_aspect, pnginput_t *pngin )
@@ -442,140 +430,6 @@ static int load_png_to_packed4444( uint8_t *buffer, int *active,
return 1;
}
-osd_graphic_t *osd_graphic_new( const char *filename, double pixel_aspect, int alpha )
-{
- osd_graphic_t *osdg = malloc( sizeof( osd_graphic_t ) );
- char *fullfilename;
- pnginput_t *pngin;
-
- if( !osdg ) {
- return 0;
- }
-
- osdg->hold = 0;
- fullfilename = get_tvtime_file( filename );
- if( !fullfilename ) {
- fprintf( stderr, "osd_graphic: Can't find '%s'. Checked: %s\n",
- filename, get_tvtime_paths() );
- free( osdg );
- return 0;
- }
- pngin = pnginput_new( fullfilename );
- free( fullfilename );
-
- if( !pngin ) {
- free( osdg );
- return 0;
- }
-
- osdg->frames_left = 0;
- osdg->alpha = alpha;
- osdg->image_width = (int) (( ((double) pnginput_get_width( pngin )) * pixel_aspect ) + 1.5);
- osdg->image_height = pnginput_get_height( pngin );
- osdg->image4444 = malloc( osdg->image_width * osdg->image_height * 4 );
- if( !osdg->image4444 ) {
- pnginput_delete( pngin );
- free( osdg );
- return 0;
- }
-
- osdg->active = malloc( osdg->image_height * sizeof( int ) );
- if( !osdg->active ) {
- pnginput_delete( pngin );
- free( osdg->image4444 );
- free( osdg );
- return 0;
- }
-
- if( !load_png_to_packed4444( osdg->image4444, osdg->active, osdg->image_width,
- osdg->image_height, osdg->image_width*4,
- pixel_aspect, pngin ) ) {
- fprintf( stderr, "osd_graphic: Can't render image '%s'.\n", filename );
- pnginput_delete( pngin );
- free( osdg->active );
- free( osdg->image4444 );
- free( osdg );
- return 0;
- }
-
- pnginput_delete( pngin );
- return osdg;
-}
-
-void osd_graphic_delete( osd_graphic_t *osdg )
-{
- free( osdg->active );
- free( osdg->image4444 );
- free( osdg );
-}
-
-int osd_graphic_get_width( osd_graphic_t *osdg )
-{
- return osdg->image_width;
-}
-
-int osd_graphic_get_height( osd_graphic_t *osdg )
-{
- return osdg->image_height;
-}
-
-void osd_graphic_set_timeout( osd_graphic_t *osdg, int timeout )
-{
- osdg->frames_left = timeout;
-}
-
-void osd_graphic_set_hold( osd_graphic_t *osdg, int hold )
-{
- osdg->hold = hold;
-}
-
-int osd_graphic_visible( osd_graphic_t *osdg )
-{
- return (osdg->frames_left > 0);
-}
-
-void osd_graphic_advance_frame( osd_graphic_t *osdg )
-{
- if( osdg->frames_left > 0) {
- if( !osdg->hold ) osdg->frames_left--;
- }
-}
-
-int osd_graphic_active_on_scanline( osd_graphic_t *osdg, int scanline )
-{
- if( scanline < osdg->image_height ) {
- return osdg->active[ scanline ];
- }
- return 0;
-}
-
-void osd_graphic_composite_packed422_scanline( osd_graphic_t *osdg,
- uint8_t *output,
- uint8_t *background,
- int width, int xpos,
- int scanline )
-{
- if( osdg->frames_left ) {
- if( scanline < osdg->image_height && xpos < osdg->image_width ) {
- int alpha;
-
- if( (xpos+width) > osdg->image_width ) {
- width = osdg->image_width - xpos;
- }
-
- if( osdg->frames_left < OSD_FADEOUT_TIME ) {
- alpha = (int) ( ( ( ( (double) osdg->frames_left ) / ((double) OSD_FADEOUT_TIME) ) * osdg->alpha ) + 0.5 );
- } else {
- alpha = osdg->alpha;
- }
-
- composite_packed4444_alpha_to_packed422_scanline( output, background,
- osdg->image4444 + (osdg->image_width*scanline*4) + (xpos*4),
- width, alpha );
- }
- }
-}
-
/* Graphic functions */
struct osd_animation_s
{
diff --git a/src/osdtools.h b/src/osdtools.h
index aa2daca..8ce4afe 100644
--- a/src/osdtools.h
+++ b/src/osdtools.h
@@ -38,7 +38,6 @@ extern "C" {
typedef struct osd_string_s osd_string_t;
typedef struct osd_font_s osd_font_t;
typedef struct osd_rect_s osd_rect_t;
-typedef struct osd_graphic_s osd_graphic_t;
typedef struct osd_animation_s osd_animation_t;
typedef struct osd_list_s osd_list_t;
@@ -105,21 +104,6 @@ void osd_rect_composite_packed422_scanline( osd_rect_t *osdr, uint8_t *output,
uint8_t *background, int width, int xpos,
int scanline );
-osd_graphic_t *osd_graphic_new( const char *filename, double pixel_aspect, int alpha );
-void osd_graphic_delete( osd_graphic_t *osdg );
-int osd_graphic_get_width( osd_graphic_t *osdg );
-int osd_graphic_get_height( osd_graphic_t *osdg );
-int osd_graphic_active_on_scanline( osd_graphic_t *osdg, int scanline );
-void osd_graphic_set_timeout( osd_graphic_t *osdg, int timeout );
-void osd_graphic_set_hold( osd_graphic_t *osdg, int hold );
-int osd_graphic_visible( osd_graphic_t *osdg );
-void osd_graphic_advance_frame( osd_graphic_t *osdg );
-void osd_graphic_composite_packed422_scanline( osd_graphic_t *osdg,
- uint8_t *output,
- uint8_t *background,
- int width, int xpos,
- int scanline );
-
osd_animation_t *osd_animation_new( const char *filename_base,
double pixel_aspect, int alpha, int frametime );
void osd_animation_delete( osd_animation_t *osda );
diff --git a/src/tvtimeosd.c b/src/tvtimeosd.c
index 74eea8c..13af2f5 100644
--- a/src/tvtimeosd.c
+++ b/src/tvtimeosd.c
@@ -96,8 +96,6 @@ struct tvtime_osd_s
int info_icon_xpos;
int info_icon_ypos;
- osd_graphic_t *backdrop;
-
char channel_number_text[ 20 ];
char channel_name_text[ 128 ];
char tv_norm_text[ 20 ];
@@ -208,17 +206,6 @@ tvtime_osd_t *tvtime_osd_new( int width, int height, double pixel_aspect,
fontfile = "tvtimeSansBold.ttf";
- /* Disable the backdrop for now. */
- if( 1 ) {
- osd->backdrop = 0;
- } else {
- if( height == 576 ) {
- osd->backdrop = osd_graphic_new( "backdrop-576.png", pixel_aspect, 256 );
- } else {
- osd->backdrop = osd_graphic_new( "backdrop-480.png", pixel_aspect, 256 );
- }
- }
-
osd->databar = osd_rect_new();
if( !osd->databar ) {
free( osd );
@@ -530,7 +517,6 @@ void tvtime_osd_hold( tvtime_osd_t *osd, int hold )
osd_string_set_hold( osd->strings[ i ].string, hold );
}
}
- if( osd->backdrop ) osd_graphic_set_hold( osd->backdrop, hold );
if( osd->film_logo ) osd_animation_set_hold( osd->film_logo, hold );
if( osd->info_icon ) osd_animation_set_hold( osd->info_icon, hold );
}
@@ -542,7 +528,6 @@ void tvtime_osd_clear( tvtime_osd_t *osd )
for( i = 0; i < OSD_MAX_STRING_OBJECTS; i++ ) {
osd_string_set_timeout( osd->strings[ i ].string, 0 );
}
- if( osd->backdrop ) osd_graphic_set_timeout( osd->backdrop, 0 );
if( osd->film_logo ) osd_animation_set_timeout( osd->film_logo, 0 );
if( osd->info_icon ) osd_animation_set_timeout( osd->info_icon, 0 );
if( osd->chinfo ) {
@@ -683,8 +668,6 @@ void tvtime_osd_show_info( tvtime_osd_t *osd )
strftime( timestamp, 50, osd->timeformat, curtime );
osd_string_show_text( osd->strings[ OSD_TIME_STRING ].string, timestamp, osd->delay );
- if( osd->backdrop ) osd_graphic_set_timeout( osd->backdrop, osd->delay );
-
osd_string_show_text( osd->strings[ OSD_CHANNEL_NUM ].string, osd->channel_number_text, osd->delay );
osd_string_show_text( osd->strings[ OSD_NETWORK_NAME ].string, osd->network_name, osd->delay );
osd_string_set_timeout( osd->strings[ OSD_SHOW_INFO ].string, osd->delay );
@@ -892,7 +875,6 @@ void tvtime_osd_advance_frame( tvtime_osd_t *osd )
osd_string_advance_frame( osd->strings[ i ].string );
}
- if( osd->backdrop ) osd_graphic_advance_frame( osd->backdrop );
if( osd->film_logo ) osd_animation_advance_frame( osd->film_logo );
if( osd->info_icon ) osd_animation_advance_frame( osd->info_icon );
osd_list_advance_frame( osd->list );
@@ -908,10 +890,6 @@ void tvtime_osd_composite_packed422_scanline( tvtime_osd_t *osd,
int iconpush = 0;
int i;
- if( osd->backdrop && osd_graphic_visible( osd->backdrop ) && osd_graphic_active_on_scanline( osd->backdrop, scanline ) ) {
- osd_graphic_composite_packed422_scanline( osd->backdrop, output, output, width, xpos, scanline );
- }
-
for( i = 0; i < OSD_MAX_STRING_OBJECTS; i++ ) {
if( osd_string_visible( osd->strings[ i ].string ) ) {
int start = osd->strings[ i ].ypos;

Privacy Policy