@@ -7,9 +7,7 @@ extern "C" {
7
7
}
8
8
9
9
#include < stdexcept>
10
- #include < iostream>
11
10
#include < iomanip>
12
- #include < sstream>
13
11
14
12
#ifdef _MSC_VER
15
13
#include < float.h>
@@ -331,7 +329,6 @@ int64_t VideoProperties::getStartTimecode() const
331
329
{
332
330
if ( ! _codecContext )
333
331
throw std::runtime_error ( " unknown codec context" );
334
-
335
332
return _codecContext->timecode_frame_start ;
336
333
}
337
334
@@ -395,119 +392,104 @@ size_t VideoProperties::getCodecId() const
395
392
{
396
393
if ( ! _codecContext )
397
394
throw std::runtime_error ( " unknown codec context" );
398
-
399
395
return _codecContext->codec_id ;
400
396
}
401
397
402
398
size_t VideoProperties::getBitRate () const
403
399
{
404
400
if ( ! _codecContext )
405
401
throw std::runtime_error ( " unknown codec context" );
406
-
407
402
return _codecContext->bit_rate ;
408
403
}
409
404
410
405
size_t VideoProperties::getMaxBitRate () const
411
406
{
412
407
if ( ! _codecContext )
413
408
throw std::runtime_error ( " unknown codec context" );
414
-
415
409
return _codecContext->rc_max_rate ;
416
410
}
417
411
418
412
size_t VideoProperties::getMinBitRate () const
419
413
{
420
414
if ( ! _codecContext )
421
415
throw std::runtime_error ( " unknown codec context" );
422
-
423
416
return _codecContext->rc_min_rate ;
424
417
}
425
418
426
419
size_t VideoProperties::getTicksPerFrame () const
427
420
{
428
421
if ( ! _codecContext )
429
422
throw std::runtime_error ( " unknown codec context" );
430
-
431
423
return _codecContext->ticks_per_frame ;
432
424
}
433
425
434
426
size_t VideoProperties::getWidth () const
435
427
{
436
428
if ( ! _codecContext )
437
429
throw std::runtime_error ( " unknown codec context" );
438
-
439
430
return _codecContext->width ;
440
431
}
441
432
442
433
size_t VideoProperties::getHeight () const
443
434
{
444
435
if ( ! _codecContext )
445
436
throw std::runtime_error ( " unknown codec context" );
446
-
447
437
return _codecContext->height ;
448
438
}
449
439
450
440
size_t VideoProperties::getGopSize () const
451
441
{
452
442
if ( ! _codecContext )
453
443
throw std::runtime_error ( " unknown codec context" );
454
-
455
444
return _codecContext->gop_size ;
456
445
}
457
446
458
447
size_t VideoProperties::getDtgActiveFormat () const
459
448
{
460
449
if ( ! _codecContext )
461
450
throw std::runtime_error ( " unknown codec context" );
462
-
463
451
return _codecContext->dtg_active_format ;
464
452
}
465
453
466
454
size_t VideoProperties::getReferencesFrames () const
467
455
{
468
456
if ( ! _codecContext )
469
457
throw std::runtime_error ( " unknown codec context" );
470
-
471
458
return _codecContext->refs ;
472
459
}
473
460
474
461
int VideoProperties::getProfile () const
475
462
{
476
463
if ( ! _codecContext )
477
464
throw std::runtime_error ( " unknown codec context" );
478
-
479
465
return _codecContext->profile ;
480
466
}
481
467
482
468
int VideoProperties::getLevel () const
483
469
{
484
470
if ( ! _codecContext )
485
471
throw std::runtime_error ( " unknown codec context" );
486
-
487
472
return _codecContext->level ;
488
473
}
489
474
490
475
size_t VideoProperties::getComponentsCount () const
491
476
{
492
477
if ( ! _pixFmt )
493
478
throw std::runtime_error ( " unknown pixel format" );
494
-
495
479
return _pixFmt->nb_components ;
496
480
}
497
481
498
482
size_t VideoProperties::getChromaWidth () const
499
483
{
500
484
if ( ! _pixFmt )
501
485
throw std::runtime_error ( " unknown pixel format" );
502
-
503
486
return _pixFmt->log2_chroma_w ;
504
487
}
505
488
506
489
size_t VideoProperties::getChromaHeight () const
507
490
{
508
491
if ( ! _pixFmt )
509
492
throw std::runtime_error ( " unknown pixel format" );
510
-
511
493
return _pixFmt->log2_chroma_h ;
512
494
}
513
495
@@ -524,47 +506,41 @@ bool VideoProperties::hasBFrames() const
524
506
{
525
507
if ( ! _codecContext )
526
508
throw std::runtime_error ( " unknown codec context" );
527
-
528
509
return (bool ) _codecContext->has_b_frames ;
529
510
}
530
511
531
512
bool VideoProperties::isIndexedColors () const
532
513
{
533
514
if ( ! _pixFmt )
534
515
throw std::runtime_error ( " unknown pixel format" );
535
-
536
516
return (bool ) _pixFmt->flags & PIX_FMT_PAL;
537
517
}
538
518
539
519
bool VideoProperties::isBitWisePacked () const
540
520
{
541
521
if ( ! _pixFmt )
542
522
throw std::runtime_error ( " unknown pixel format" );
543
-
544
523
return (bool ) _pixFmt->flags & PIX_FMT_BITSTREAM;
545
524
}
546
525
547
526
bool VideoProperties::isHardwareAccelerated () const
548
527
{
549
528
if ( ! _pixFmt )
550
529
throw std::runtime_error ( " unknown pixel format" );
551
-
552
530
return (bool ) _pixFmt->flags & PIX_FMT_HWACCEL;
553
531
}
554
532
555
533
bool VideoProperties::isPlanar () const
556
534
{
557
535
if ( ! _pixFmt )
558
536
throw std::runtime_error ( " unknown pixel format" );
559
-
560
537
return (bool ) _pixFmt->flags & PIX_FMT_PLANAR;
561
538
}
562
539
563
540
bool VideoProperties::isRgbPixelData () const
564
541
{
565
542
if ( ! _pixFmt )
566
543
throw std::runtime_error ( " unknown pixel format" );
567
-
568
544
return (bool ) _pixFmt->flags & PIX_FMT_RGB;
569
545
}
570
546
0 commit comments