Changeset 3977

Show
Ignore:
Timestamp:
03/27/07 11:23:40 (7 years ago)
Author:
piers
Message:

Updates for Windows compile - and fix for encoder-h264 destructor.

Location:
vic/branches/mpeg4/codec
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/mpeg4/codec/decoder-h264.cpp

    r3975 r3977  
    66#include <errno.h> 
    77#include <fcntl.h> 
     8#include <io.h> 
     9#include <sys/stat.h> 
    810#include "inet.h" 
    911#include "rtp.h" 
     
    123125{ 
    124126    char SdpFilename[SDP_LINE_LEN]; 
    125     char *line, *sdp_string; 
     127    char *sdp_string; 
    126128    char *SdpLine=NULL; 
    127129    int n_char; 
     
    129131    struct stat      s; 
    130132    size_t nBytes = 0; 
    131     ssize_t SdpRead; 
    132133    char defaultSDP[]="a=rtpmap:96 H264/90000\na=fmtp:96 profile-level-id=00000d; packetization-mode=1\n"; 
    133134 
     
    151152      close(sdp_fptr); 
    152153    } else { 
    153       fprintf(stderr, "H264_RTP: Couldn't open SDP file %s to read. Errno = %d\n", SdpFilename, errno); 
    154       fprintf(stderr, "H264_RTP: Using default SDP: %s \n", defaultSDP); 
     154      debug_msg( "H264_RTP: Couldn't open SDP file %s to read. Errno = %d\n", SdpFilename, errno); 
     155      debug_msg("H264_RTP: Using default SDP: %s \n", defaultSDP); 
    155156      sdp_string=defaultSDP; 
    156157    } 
    157158 
    158     do { 
    159       n_char = strcspn(sdp_string, "\n"); 
     159    while ((n_char = strcspn(sdp_string, "\n"))!=0) { 
    160160      SdpLine=(char*)realloc((void*)SdpLine, n_char+1); 
    161161      memset(SdpLine, '\0', n_char+1); 
    162162      strncpy(SdpLine, sdp_string, n_char); 
    163163      sdp_string += n_char + 1; 
    164         h264depayloader->parse_h264_sdp_line(h264.c, h264depayloader->h264_extradata, SdpLine); 
    165     } while (n_char != 0); 
     164      h264depayloader->parse_h264_sdp_line(h264.c, h264depayloader->h264_extradata, SdpLine); 
     165    } 
    166166    free(SdpLine); 
    167167} 
  • vic/branches/mpeg4/codec/encoder-h264.cpp

    r3976 r3977  
    7777    kbps = 512; 
    7878    gop = 20; 
     79    fOut=NULL; 
    7980} 
    8081 
     
    8283{ 
    8384    delete enc; 
    84     delete fOut; 
     85    if (fOut) delete fOut; 
    8586} 
    8687 
  • vic/branches/mpeg4/codec/rtp_h264_depayloader.cpp

    r3974 r3977  
    4343#include "config.h" 
    4444 
    45  
     45#ifndef WIN32 
    4646#include <unistd.h> 
    4747#include <sys/types.h> 
    4848#include <sys/socket.h> 
    4949#include <netinet/in.h> 
     50#include <arpa/inet.h> 
     51#include <netdb.h> 
     52#endif 
    5053#include <assert.h> 
    5154//#ifndef __BEOS__ 
    52 # include <arpa/inet.h> 
    5355//#else 
    5456//# include "barpainet.h" 
    5557//#endif 
    56 #include <netdb.h> 
    5758 
    5859#include "rtp_h264_depayloader.h" 
    5960#include "packetbuffer.h" 
    6061 
    61 using namespace std; 
     62//using namespace std; 
    6263 
    6364 
     
    232233 
    233234            buffer[0] = value[0]; buffer[1] = value[1]; buffer[2] = '\0'; 
    234             profile_idc = strtol(buffer, NULL, 16); 
     235            profile_idc = (uint8_t)strtol(buffer, NULL, 16); 
    235236            buffer[0] = value[2]; buffer[1] = value[3]; 
    236             profile_iop = strtol(buffer, NULL, 16); 
     237            profile_iop = (uint8_t)strtol(buffer, NULL, 16); 
    237238            buffer[0] = value[4]; buffer[1] = value[5]; 
    238             level_idc = strtol(buffer, NULL, 16); 
     239            level_idc = (uint8_t)strtol(buffer, NULL, 16); 
    239240 
    240241            // set the parameters... 
     
    297298                              int len) 
    298299{ 
    299  
    300      char *temp; //SV: XXX 
    301  
    302300    //h264_rtp_extra_data *data = s->dynamic_protocol_context; 
    303301    uint8_t nal = buf[0];