QTfrontend/util/libav_iteraction.cpp
changeset 7544 a72ace943bfd
parent 7528 f8cf277dca36
child 7617 0ac281e1b58b
equal deleted inserted replaced
7542:37ef1891efe2 7544:a72ace943bfd
    93 
    93 
    94         // doesn't support stereo sound
    94         // doesn't support stereo sound
    95         if (strcmp(pCodec->name, "real_144") == 0)
    95         if (strcmp(pCodec->name, "real_144") == 0)
    96             continue;
    96             continue;
    97 
    97 
       
    98         if (!pCodec->long_name || strlen(pCodec->long_name) == 0)
       
    99             continue;
       
   100 
    98         if (pCodec->type == AVMEDIA_TYPE_VIDEO)
   101         if (pCodec->type == AVMEDIA_TYPE_VIDEO)
    99         {
   102         {
   100             if (pCodec->supported_framerates != NULL)
   103             if (pCodec->supported_framerates != NULL)
   101                 continue;
   104                 continue;
   102 
   105 
   118             // check if codec supports signed 16-bit format
   121             // check if codec supports signed 16-bit format
   119             if (!pCodec->sample_fmts)
   122             if (!pCodec->sample_fmts)
   120                 continue;
   123                 continue;
   121             bool s16Supported = false;
   124             bool s16Supported = false;
   122             for (const AVSampleFormat* pfmt = pCodec->sample_fmts; *pfmt != -1; pfmt++)
   125             for (const AVSampleFormat* pfmt = pCodec->sample_fmts; *pfmt != -1; pfmt++)
   123                 if (*pfmt == AV_SAMPLE_FMT_S16/* || *pfmt == AV_SAMPLE_FMT_FLT*/)
   126                 if (*pfmt == AV_SAMPLE_FMT_S16)
   124                 {
   127                 {
   125                     s16Supported = true;
   128                     s16Supported = true;
   126                     break;
   129                     break;
   127                 }
   130                 }
   128             if (!s16Supported)
   131             if (!s16Supported)
   157 
   160 
   158         if (strcmp(pCodec->name, "mpeg4") == 0 || strcmp(pCodec->name, "ac3_fixed") == 0)
   161         if (strcmp(pCodec->name, "mpeg4") == 0 || strcmp(pCodec->name, "ac3_fixed") == 0)
   159             codec.isRecomended = true;
   162             codec.isRecomended = true;
   160 
   163 
   161         // FIXME: remove next line
   164         // FIXME: remove next line
   162         codec.longName += QString(" (%1)").arg(codec.shortName);
   165         //codec.longName += QString(" (%1)").arg(codec.shortName);
   163     }
   166     }
   164 
   167 
   165     // get list of all formats
   168     // get list of all formats
   166     AVOutputFormat* pFormat = NULL;
   169     AVOutputFormat* pFormat = NULL;
   167     while (pFormat = av_oformat_next(pFormat))
   170     while (pFormat = av_oformat_next(pFormat))
   191         format.extension = ext;
   194         format.extension = ext;
   192         format.shortName = pFormat->name;
   195         format.shortName = pFormat->name;
   193         format.longName = QString("%1 (*.%2)").arg(pFormat->long_name).arg(ext);
   196         format.longName = QString("%1 (*.%2)").arg(pFormat->long_name).arg(ext);
   194 
   197 
   195         // FIXME: remove next line
   198         // FIXME: remove next line
   196         format.longName += QString(" (%1)").arg(format.shortName);
   199         //format.longName += QString(" (%1)").arg(format.shortName);
   197 
   200 
   198         format.isRecomended = strcmp(pFormat->name, "mp4") == 0 || strcmp(pFormat->name, "avi") == 0;
   201         format.isRecomended = strcmp(pFormat->name, "mp4") == 0 || strcmp(pFormat->name, "avi") == 0;
   199 
   202 
   200         formats[pFormat->name] = format;
   203         formats[pFormat->name] = format;
   201     }
   204     }