Changeset 178
- Timestamp:
- 07/14/08 11:03:13 (2 months ago)
- Files:
-
- trunk/examples/connect.c (modified) (1 diff)
- trunk/examples/decode_mpeg.c (modified) (12 diffs)
- trunk/examples/decode_pat.c (modified) (2 diffs)
- trunk/examples/decode_pmt.c (modified) (8 diffs)
- trunk/examples/decode_sdt.c (modified) (4 diffs)
- trunk/misc/gen_crc.c (modified) (1 diff)
- trunk/misc/gen_pat.c (modified) (1 diff)
- trunk/misc/gen_pmt.c (modified) (1 diff)
- trunk/misc/test_dr.c (modified) (16 diffs)
- trunk/src/descriptors/dr_4e.c (modified) (1 diff)
- trunk/src/tables/cat.c (modified) (1 diff)
- trunk/src/tables/eit.c (modified) (2 diffs)
- trunk/src/tables/nit.c (modified) (2 diffs)
- trunk/src/tables/pat.c (modified) (1 diff)
- trunk/src/tables/pmt.c (modified) (2 diffs)
- trunk/src/tables/sdt.c (modified) (3 diffs)
- trunk/src/tables/tot_private.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/examples/connect.c
r167 r178 44 44 #include <netinet/udp.h> 45 45 #include <arpa/inet.h> 46 47 #include "connect.h" 46 48 47 49 int create_tcp_connection( const char *ipaddress, int port ) trunk/examples/decode_mpeg.c
r175 r178 138 138 * Local prototypes 139 139 *****************************************************************************/ 140 void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt);140 static void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt); 141 141 142 142 /***************************************************************************** 143 143 * ReadPacket 144 144 *****************************************************************************/ 145 int ReadPacket( int i_fd, uint8_t* p_dst )145 static int ReadPacket( int i_fd, uint8_t* p_dst ) 146 146 { 147 147 int i = 187; … … 165 165 166 166 #ifdef HAVE_SYS_SOCKET_H 167 int ReadPacketFromSocket( int i_socket, uint8_t* p_dst, size_t i_size)167 static int ReadPacketFromSocket( int i_socket, uint8_t* p_dst, size_t i_size) 168 168 { 169 169 int i_rc = -1; … … 173 173 if( i_rc < 0 ) printf( "READ INTERRUPTED BY SIGNAL\n" ); 174 174 if( i_rc == 0 ) printf( "READ RETURNS 0\n" ); 175 return (i_rc <= i_size ) ? 1 : 0;175 return (i_rc <= (int)i_size ) ? 1 : 0; 176 176 } 177 177 #endif … … 180 180 * DumpPAT 181 181 *****************************************************************************/ 182 void DumpPAT(void* p_data, dvbpsi_pat_t* p_pat)182 static void DumpPAT(void* p_data, dvbpsi_pat_t* p_pat) 183 183 { 184 184 dvbpsi_pat_program_t* p_program = p_pat->p_first_program; … … 212 212 * GetTypeName 213 213 *****************************************************************************/ 214 char* GetTypeName(uint8_t type)214 static char const* GetTypeName(uint8_t type) 215 215 { 216 216 switch (type) … … 257 257 * DumpMaxBitrateDescriptor 258 258 *****************************************************************************/ 259 void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor)259 static void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor) 260 260 { 261 261 printf("Bitrate: %d\n", bitrate_descriptor->i_max_bitrate); … … 265 265 * DumpSystemClockDescriptor 266 266 *****************************************************************************/ 267 void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor)267 static void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor) 268 268 { 269 269 printf("External clock: %s, Accuracy: %E\n", … … 276 276 * DumpStreamIdentifierDescriptor 277 277 *****************************************************************************/ 278 void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor)278 static void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor) 279 279 { 280 280 printf("Component tag: %d\n", … … 285 285 * DumpSubtitleDescriptor 286 286 *****************************************************************************/ 287 void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor)287 static void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor) 288 288 { 289 289 int a; … … 305 305 * DumpDescriptors 306 306 *****************************************************************************/ 307 void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor)307 static void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 308 308 { 309 309 int i; … … 339 339 * DumpPMT 340 340 *****************************************************************************/ 341 void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt)341 static void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt) 342 342 { 343 343 dvbpsi_pmt_es_t* p_es = p_pmt->p_first_es; … … 368 368 * usage 369 369 *****************************************************************************/ 370 void usage( char *name )370 static void usage( char *name ) 371 371 { 372 372 #ifdef HAVE_SYS_SOCKET_H trunk/examples/decode_pat.c
r104 r178 54 54 * ReadPacket 55 55 *****************************************************************************/ 56 int ReadPacket(int i_fd, uint8_t* p_dst)56 static int ReadPacket(int i_fd, uint8_t* p_dst) 57 57 { 58 58 int i = 187; … … 80 80 * DumpPAT 81 81 *****************************************************************************/ 82 void DumpPAT(void* p_zero, dvbpsi_pat_t* p_pat)82 static void DumpPAT(void* p_zero, dvbpsi_pat_t* p_pat) 83 83 { 84 84 dvbpsi_pat_program_t* p_program = p_pat->p_first_program; trunk/examples/decode_pmt.c
r134 r178 63 63 * ReadPacket 64 64 *****************************************************************************/ 65 int ReadPacket(int i_fd, uint8_t* p_dst)65 static int ReadPacket(int i_fd, uint8_t* p_dst) 66 66 { 67 67 int i = 187; … … 88 88 * GetTypeName 89 89 *****************************************************************************/ 90 char* GetTypeName(uint8_t type)90 static char* GetTypeName(uint8_t type) 91 91 { 92 92 switch (type) … … 133 133 * DumpMaxBitrateDescriptor 134 134 *****************************************************************************/ 135 void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor)135 static void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor) 136 136 { 137 137 printf("Bitrate: %d\n", bitrate_descriptor->i_max_bitrate); … … 141 141 * DumpSystemClockDescriptor 142 142 *****************************************************************************/ 143 void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor)143 static void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor) 144 144 { 145 145 printf("External clock: %s, Accuracy: %E\n", … … 152 152 * DumpStreamIdentifierDescriptor 153 153 *****************************************************************************/ 154 void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor)154 static void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor) 155 155 { 156 156 printf("Component tag: %d\n", … … 161 161 * DumpSubtitleDescriptor 162 162 *****************************************************************************/ 163 void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor)163 static void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor) 164 164 { 165 165 int a; … … 181 181 * DumpDescriptors 182 182 *****************************************************************************/ 183 void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor)183 static void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 184 184 { 185 185 int i; … … 216 216 * DumpPMT 217 217 *****************************************************************************/ 218 void DumpPMT(void* p_zero, dvbpsi_pmt_t* p_pmt)218 static void DumpPMT(void* p_zero, dvbpsi_pmt_t* p_pmt) 219 219 { 220 220 dvbpsi_pmt_es_t* p_es = p_pmt->p_first_es; trunk/examples/decode_sdt.c
r88 r178 59 59 * ReadPacket 60 60 *****************************************************************************/ 61 int ReadPacket(int i_fd, uint8_t* p_dst)61 static int ReadPacket(int i_fd, uint8_t* p_dst) 62 62 { 63 63 int i = 187; … … 85 85 * DumpDescriptors 86 86 *****************************************************************************/ 87 void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor)87 static void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 88 88 { 89 89 while(p_descriptor) … … 102 102 * DumpSDT 103 103 *****************************************************************************/ 104 void DumpSDT(void* p_zero, dvbpsi_sdt_t* p_sdt)104 static void DumpSDT(void* p_zero, dvbpsi_sdt_t* p_sdt) 105 105 { 106 106 dvbpsi_sdt_service_t* p_service = p_sdt->p_first_service; … … 127 127 * NewSubtable 128 128 *****************************************************************************/ 129 void NewSubtable(void * p_zero, dvbpsi_handle h_dvbpsi,129 static void NewSubtable(void * p_zero, dvbpsi_handle h_dvbpsi, 130 130 uint8_t i_table_id, uint16_t i_extension) 131 131 { trunk/misc/gen_crc.c
r88 r178 39 39 * main 40 40 *****************************************************************************/ 41 int main( )41 int main(void) 42 42 { 43 43 uint32_t table[256]; trunk/misc/gen_pat.c
r88 r178 51 51 * writePSI 52 52 *****************************************************************************/ 53 void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section)53 static void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section) 54 54 { 55 55 p_packet[0] = 0x47; trunk/misc/gen_pmt.c
r149 r178 53 53 * writePSI 54 54 *****************************************************************************/ 55 void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section)55 static void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section) 56 56 { 57 57 p_packet[0] = 0x47; trunk/misc/test_dr.c
r137 r178 26 26 #include "test_dr.h" 27 27 28 28 29 29 /* video stream (b_mpeg2 = false) */ 30 int main_vstream_1()30 static int main_vstream_1(void) 31 31 { 32 32 BOZO_VARS(vstream); 33 33 BOZO_START(video stream (b_mpeg2 = false)); 34 34 35 35 36 36 /* check b_multiple_frame_rate */ 37 37 BOZO_init_boolean(b_multiple_frame_rate, 0); … … 89 89 90 90 /* video stream (b_mpeg2 = true) */ 91 int main_vstream_2()91 static int main_vstream_2(void) 92 92 { 93 93 BOZO_VARS(vstream); 94 94 BOZO_START(video stream (b_mpeg2 = true)); 95 95 96 96 97 97 /* check b_multiple_frame_rate */ 98 98 BOZO_init_boolean(b_multiple_frame_rate, 0); … … 207 207 208 208 /* audio stream */ 209 int main_astream_()209 static int main_astream_(void) 210 210 { 211 211 BOZO_VARS(astream); 212 212 BOZO_START(audio stream); 213 213 214 214 215 215 /* check b_free_format */ 216 216 BOZO_init_boolean(b_free_format, 0); … … 250 250 251 251 /* hierarchy */ 252 int main_hierarchy_()252 static int main_hierarchy_(void) 253 253 { 254 254 BOZO_VARS(hierarchy); 255 255 BOZO_START(hierarchy); 256 256 257 257 258 258 /* check i_h_type */ 259 259 BOZO_init_integer(i_h_type, 0); … … 307 307 308 308 /* registration */ 309 int main_registration_()309 static int main_registration_(void) 310 310 { 311 311 BOZO_VARS(registration); 312 312 BOZO_START(registration); 313 313 314 314 315 315 /* check i_format_identifier */ 316 316 s_decoded.i_additional_length = 0; … … 329 329 330 330 /* data stream alignment */ 331 int main_ds_alignment_()331 static int main_ds_alignment_(void) 332 332 { 333 333 BOZO_VARS(ds_alignment); 334 334 BOZO_START(data stream alignment); 335 335 336 336 337 337 /* check i_alignment_type */ 338 338 BOZO_init_integer(i_alignment_type, 0); … … 350 350 351 351 /* target background grid */ 352 int main_target_bg_grid_()352 static int main_target_bg_grid_(void) 353 353 { 354 354 BOZO_VARS(target_bg_grid); 355 355 BOZO_START(target background grid); 356 356 357 357 358 358 /* check i_horizontal_size */ 359 359 BOZO_init_integer(i_horizontal_size, 0); … … 393 393 394 394 /* video window */ 395 int main_vwindow_()395 static int main_vwindow_(void) 396 396 { 397 397 BOZO_VARS(vwindow); 398 398 BOZO_START(video window); 399 399 400 400 401 401 /* check i_horizontal_offset */ 402 402 BOZO_init_integer(i_horizontal_offset, 0); … … 436 436 437 437 /* conditional access */ 438 int main_ca_()438 static int main_ca_(void) 439 439 { 440 440 BOZO_VARS(ca); 441 441 BOZO_START(conditional access); 442 442 443 443 444 444 /* check i_ca_system_id */ 445 445 s_decoded.i_private_length = 0; … … 469 469 470 470 /* system clock */ 471 int main_system_clock_()471 static int main_system_clock_(void) 472 472 { 473 473 BOZO_VARS(system_clock); 474 474 BOZO_START(system clock); 475 475 476 476 477 477 /* check b_external_clock_ref */ 478 478 BOZO_init_boolean(b_external_clock_ref, 0); … … 512 512 513 513 /* multiplex buffer utilization */ 514 int main_mx_buff_utilization_()514 static int main_mx_buff_utilization_(void) 515 515 { 516 516 BOZO_VARS(mx_buff_utilization); 517 517 BOZO_START(multiplex buffer utilization); 518 518 519 519 520 520 /* check b_mdv_valid */ 521 521 BOZO_init_boolean(b_mdv_valid, 0); … … 555 555 556 556 /* copyright */ 557 int main_copyright_()557 static int main_copyright_(void) 558 558 { 559 559 BOZO_VARS(copyright); 560 560 BOZO_START(copyright); 561 561 562 562 563 563 /* check i_copyright_identifier */ 564 564 s_decoded.i_additional_length = 0; … … 577 577 578 578 /* maximum bitrate */ 579 int main_max_bitrate_()579 static int main_max_bitrate_(void) 580 580 { 581 581 BOZO_VARS(max_bitrate); 582 582 BOZO_START(maximum bitrate); 583 583 584 584 585 585 /* check i_max_bitrate */ 586 586 BOZO_init_integer(i_max_bitrate, 0); … … 598 598 599 599 /* private data indicator */ 600 int main_private_data_()600 static int main_private_data_(void) 601 601 { 602 602 BOZO_VARS(private_data); 603 603 BOZO_START(private data indicator); 604 604 605 605 606 606 /* check i_private_data */ 607 607 BOZO_init_integer(i_private_data, 0); … … 619 619 620 620 /* service */ 621 int main_service_()621 static int main_service_(void) 622 622 { 623 623 BOZO_VARS(service); 624 624 BOZO_START(service); 625 625 626 626 627 627 /* check i_service_type */ 628 628 s_decoded.i_service_provider_name_length = 0; … … 643 643 644 644 /* main function */ 645 int main( )645 int main(void) 646 646 { 647 647 int i_err = 0; 648 648 649 649 i_err |= main_vstream_1(); 650 650 i_err |= main_vstream_2(); trunk/src/descriptors/dr_4e.c
r105 r178 131 131 { 132 132 uint8_t *p = &p_descriptor->p_data[0]; 133 int i;134 133 135 134 /* Encode data */ trunk/src/tables/cat.c
r146 r178 335 335 if(p_cat_decoder->i_last_section_number) 336 336 { 337 for(i = 0; i <= p_cat_decoder->i_last_section_number - 1; i++)337 for(i = 0; (int)i <= p_cat_decoder->i_last_section_number - 1; i++) 338 338 p_cat_decoder->ap_sections[i]->p_next = 339 339 p_cat_decoder->ap_sections[i + 1]; trunk/src/tables/eit.c
r144 r178 531 531 uint8_t i_running_status = (uint8_t)(p_byte[10]) >> 5; 532 532 int b_free_ca = (int)(p_byte[10] & 0x10) >> 4; 533 uint16_t i_ length = ((uint16_t)(p_byte[10] & 0xf) << 8) | p_byte[11];533 uint16_t i_ev_length = ((uint16_t)(p_byte[10] & 0xf) << 8) | p_byte[11]; 534 534 dvbpsi_eit_event_t* p_event = dvbpsi_EITAddEvent(p_eit, 535 535 i_event_id, i_start_time, i_duration, … … 537 537 /* Event descriptors */ 538 538 p_byte += 12; 539 p_end = p_byte + i_ length;539 p_end = p_byte + i_ev_length; 540 540 while(p_byte + 2 <= p_end) 541 541 { trunk/src/tables/nit.c
r170 r178 463 463 if(p_nit_decoder->i_last_section_number) 464 464 { 465 for(i = 0; i <= p_nit_decoder->i_last_section_number - 1; i++)465 for(i = 0; (int)i <= p_nit_decoder->i_last_section_number - 1; i++) 466 466 p_nit_decoder->ap_sections[i]->p_next = 467 467 p_nit_decoder->ap_sections[i + 1]; … … 527 527 uint16_t i_ts_id = ((uint16_t)p_byte[0] << 8) | p_byte[1]; 528 528 uint16_t i_orig_network_id = ((uint16_t)p_byte[2] << 8) | p_byte[3]; 529 uint16_t i_ length = ((uint16_t)(p_byte[4] & 0x0f) << 8) | p_byte[5];529 uint16_t i_ts_length = ((uint16_t)(p_byte[4] & 0x0f) << 8) | p_byte[5]; 530 530 dvbpsi_nit_ts_t* p_ts = dvbpsi_NITAddTS(p_nit, i_ts_id, i_orig_network_id); 531 531 /* - TS descriptors */ 532 532 p_byte += 6; 533 p_end2 = p_byte + i_ length;533 p_end2 = p_byte + i_ts_length; 534 534 if( p_end2 > p_section->p_payload_end ) 535 535 { trunk/src/tables/pat.c
r108 r178 353 353 if(p_pat_decoder->i_last_section_number) 354 354 { 355 for(i = 0; i <= p_pat_decoder->i_last_section_number - 1; i++)355 for(i = 0; (int)i <= p_pat_decoder->i_last_section_number - 1; i++) 356 356 p_pat_decoder->ap_sections[i]->p_next = 357 357 p_pat_decoder->ap_sections[i + 1]; trunk/src/tables/pmt.c
r108 r178 428 428 if(p_pmt_decoder->i_last_section_number) 429 429 { 430 for(i = 0; i <= p_pmt_decoder->i_last_section_number - 1; i++)430 for(i = 0; (int)i <= p_pmt_decoder->i_last_section_number - 1; i++) 431 431 p_pmt_decoder->ap_sections[i]->p_next = 432 432 p_pmt_decoder->ap_sections[i + 1]; … … 483 483 uint8_t i_type = p_byte[0]; 484 484 uint16_t i_pid = ((uint16_t)(p_byte[1] & 0x1f) << 8) | p_byte[2]; 485 uint16_t i_ length = ((uint16_t)(p_byte[3] & 0x0f) << 8) | p_byte[4];485 uint16_t i_es_length = ((uint16_t)(p_byte[3] & 0x0f) << 8) | p_byte[4]; 486 486 dvbpsi_pmt_es_t* p_es = dvbpsi_PMTAddES(p_pmt, i_type, i_pid); 487 487 /* - ES descriptors */ 488 488 p_byte += 5; 489 p_end = p_byte + i_ length;489 p_end = p_byte + i_es_length; 490 490 if( p_end > p_section->p_payload_end ) 491 491 { trunk/src/tables/sdt.c
r110 r178 429 429 if(p_sdt_decoder->i_last_section_number) 430 430 { 431 for(i = 0; i <= p_sdt_decoder->i_last_section_number - 1; i++)431 for(i = 0; (int)i <= p_sdt_decoder->i_last_section_number - 1; i++) 432 432 p_sdt_decoder->ap_sections[i]->p_next = 433 433 p_sdt_decoder->ap_sections[i + 1]; … … 474 474 uint8_t i_running_status = (uint8_t)(p_byte[3]) >> 5; 475 475 int b_free_ca = (int)((p_byte[3] & 0x10) >> 4); 476 uint16_t i_ length = ((uint16_t)(p_byte[3] & 0xf) <<8) | p_byte[4];476 uint16_t i_srv_length = ((uint16_t)(p_byte[3] & 0xf) <<8) | p_byte[4]; 477 477 dvbpsi_sdt_service_t* p_service = dvbpsi_SDTAddService(p_sdt, 478 478 i_service_id, b_eit_schedule, b_eit_present, … … 481 481 /* Service descriptors */ 482 482 p_byte += 5; 483 p_end = p_byte + i_ length;483 p_end = p_byte + i_srv_length; 484 484 if( p_end > p_section->p_payload_end ) break; 485 485 trunk/src/tables/tot_private.h
r170 r178 54 54 55 55 /***************************************************************************** 56 * dvbpsi_ValidTOTSection 57 ***************************************************************************** 58 * Check the CRC_32 if the section has b_syntax_indicator set. 59 *****************************************************************************/ 60 int dvbpsi_ValidTOTSection(dvbpsi_psi_section_t* p_section); 61 62 /***************************************************************************** 56 63 * dvbpsi_DecodeTOTSections 57 64 *****************************************************************************
