Changeset 2720 for trunk/packages
- Timestamp:
- Dec 6, 2011, 8:03:57 PM (13 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/RpAVTranslate.cpp
r2376 r2720 34 34 35 35 #include "RpAVTranslate.h" 36 37 #if LIBAVUTIL_VERSION_MAJOR < 51 38 #define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO 39 #define AV_PKT_FLAG_KEY PKT_FLAG_KEY 40 #define av_guess_format guess_format 41 #define av_dump_format dump_format 42 #define avio_open url_fopen 43 #define avio_close url_fclose 44 #endif /* LIBAVUTIL_VERSION_MAJOR */ 36 45 37 46 #ifndef M_PI … … 101 110 102 111 /* Auto detect the output format from the name. default is mpeg. */ 103 _fmtPtr = guess_format(NULL, filename, NULL);112 _fmtPtr = av_guess_format(NULL, filename, NULL); 104 113 if (_fmtPtr == NULL) { 105 114 /* … … 107 116 "file extension: using MPEG.\n"); 108 117 */ 109 _fmtPtr = guess_format("mpeg", NULL, NULL);118 _fmtPtr = av_guess_format("mpeg", NULL, NULL); 110 119 } 111 120 if (_fmtPtr == NULL) { … … 136 145 } 137 146 147 #if LIBAVUTIL_VERSION_MAJOR < 51 138 148 /* Set the output parameters (must be done even if no parameters). */ 139 149 if (av_set_parameters(_ocPtr, NULL) < 0) { … … 141 151 return false; 142 152 } 143 144 dump_format(_ocPtr, 0, filename, 1);153 #endif 154 av_dump_format(_ocPtr, 0, filename, 1); 145 155 146 156 /* Now that all the parameters are set, we can open the video codec and … … 154 164 /* Open the output file, if needed. */ 155 165 if (!(_fmtPtr->flags & AVFMT_NOFILE)) { 156 if ( url_fopen(&_ocPtr->pb, filename, URL_WRONLY) < 0) {166 if (avio_open(&_ocPtr->pb, filename, URL_WRONLY) < 0) { 157 167 status.addError("Could not open '%s'", filename); 158 168 return false; … … 161 171 162 172 /* write the stream header, if any */ 173 #if LIBAVUTIL_VERSION_MAJOR < 51 163 174 av_write_header(_ocPtr); 175 #else 176 avformat_write_header(_ocPtr, NULL); 177 #endif 164 178 return true; 165 179 } … … 226 240 if (!(_fmtPtr->flags & AVFMT_NOFILE)) { 227 241 /* close the output file */ 228 url_fclose(_ocPtr->pb);242 avio_close(_ocPtr->pb); 229 243 } 230 244 … … 257 271 codecPtr = streamPtr->codec; 258 272 codecPtr->codec_id = codec_id; 259 codecPtr->codec_type = CODEC_TYPE_VIDEO;273 codecPtr->codec_type = AVMEDIA_TYPE_VIDEO; 260 274 261 275 /* Put sample parameters */ … … 393 407 _avStreamPtr->time_base); 394 408 if (codecPtr->coded_frame->key_frame) { 395 pkt.flags |= PKT_FLAG_KEY;409 pkt.flags |= AV_PKT_FLAG_KEY; 396 410 } 397 411 pkt.stream_index = _avStreamPtr->index; -
trunk/packages/vizservers/nanovis/nanovis.cpp
r2392 r2720 754 754 755 755 if(lastError) { 756 const char *listing = cgGetLastListing(g_context);757 756 TRACE("\n---------------------------------------------------\n"); 758 757 TRACE("%s\n\n", cgGetErrorString(lastError)); 759 TRACE("%s\n", listing);758 TRACE("%s\n", cgGetLastListing(g_context)); 760 759 TRACE("-----------------------------------------------------\n"); 761 760 TRACE("Cg error, exiting...\n"); … … 2249 2248 char *newPath; 2250 2249 struct timeval tv; 2251 int n, i;2252 2250 newPath = NULL; 2253 2251 path = NULL;
Note: See TracChangeset
for help on using the changeset viewer.