Skip to content

Commit ec7852c

Browse files
author
Clement Champetier
committed
VideoProperties: clean
1 parent 9c432e8 commit ec7852c

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

src/AvTranscoder/mediaProperty/VideoProperties.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ extern "C" {
77
}
88

99
#include <stdexcept>
10-
#include <iostream>
1110
#include <iomanip>
12-
#include <sstream>
1311

1412
#ifdef _MSC_VER
1513
#include <float.h>
@@ -331,7 +329,6 @@ int64_t VideoProperties::getStartTimecode() const
331329
{
332330
if( ! _codecContext )
333331
throw std::runtime_error( "unknown codec context" );
334-
335332
return _codecContext->timecode_frame_start;
336333
}
337334

@@ -395,119 +392,104 @@ size_t VideoProperties::getCodecId() const
395392
{
396393
if( ! _codecContext )
397394
throw std::runtime_error( "unknown codec context" );
398-
399395
return _codecContext->codec_id;
400396
}
401397

402398
size_t VideoProperties::getBitRate() const
403399
{
404400
if( ! _codecContext )
405401
throw std::runtime_error( "unknown codec context" );
406-
407402
return _codecContext->bit_rate;
408403
}
409404

410405
size_t VideoProperties::getMaxBitRate() const
411406
{
412407
if( ! _codecContext )
413408
throw std::runtime_error( "unknown codec context" );
414-
415409
return _codecContext->rc_max_rate;
416410
}
417411

418412
size_t VideoProperties::getMinBitRate() const
419413
{
420414
if( ! _codecContext )
421415
throw std::runtime_error( "unknown codec context" );
422-
423416
return _codecContext->rc_min_rate;
424417
}
425418

426419
size_t VideoProperties::getTicksPerFrame() const
427420
{
428421
if( ! _codecContext )
429422
throw std::runtime_error( "unknown codec context" );
430-
431423
return _codecContext->ticks_per_frame;
432424
}
433425

434426
size_t VideoProperties::getWidth() const
435427
{
436428
if( ! _codecContext )
437429
throw std::runtime_error( "unknown codec context" );
438-
439430
return _codecContext->width;
440431
}
441432

442433
size_t VideoProperties::getHeight() const
443434
{
444435
if( ! _codecContext )
445436
throw std::runtime_error( "unknown codec context" );
446-
447437
return _codecContext->height;
448438
}
449439

450440
size_t VideoProperties::getGopSize() const
451441
{
452442
if( ! _codecContext )
453443
throw std::runtime_error( "unknown codec context" );
454-
455444
return _codecContext->gop_size;
456445
}
457446

458447
size_t VideoProperties::getDtgActiveFormat() const
459448
{
460449
if( ! _codecContext )
461450
throw std::runtime_error( "unknown codec context" );
462-
463451
return _codecContext->dtg_active_format;
464452
}
465453

466454
size_t VideoProperties::getReferencesFrames() const
467455
{
468456
if( ! _codecContext )
469457
throw std::runtime_error( "unknown codec context" );
470-
471458
return _codecContext->refs;
472459
}
473460

474461
int VideoProperties::getProfile() const
475462
{
476463
if( ! _codecContext )
477464
throw std::runtime_error( "unknown codec context" );
478-
479465
return _codecContext->profile;
480466
}
481467

482468
int VideoProperties::getLevel() const
483469
{
484470
if( ! _codecContext )
485471
throw std::runtime_error( "unknown codec context" );
486-
487472
return _codecContext->level;
488473
}
489474

490475
size_t VideoProperties::getComponentsCount() const
491476
{
492477
if( ! _pixFmt )
493478
throw std::runtime_error( "unknown pixel format" );
494-
495479
return _pixFmt->nb_components;
496480
}
497481

498482
size_t VideoProperties::getChromaWidth() const
499483
{
500484
if( ! _pixFmt )
501485
throw std::runtime_error( "unknown pixel format" );
502-
503486
return _pixFmt->log2_chroma_w;
504487
}
505488

506489
size_t VideoProperties::getChromaHeight() const
507490
{
508491
if( ! _pixFmt )
509492
throw std::runtime_error( "unknown pixel format" );
510-
511493
return _pixFmt->log2_chroma_h;
512494
}
513495

@@ -524,47 +506,41 @@ bool VideoProperties::hasBFrames() const
524506
{
525507
if( ! _codecContext )
526508
throw std::runtime_error( "unknown codec context" );
527-
528509
return (bool) _codecContext->has_b_frames;
529510
}
530511

531512
bool VideoProperties::isIndexedColors() const
532513
{
533514
if( ! _pixFmt )
534515
throw std::runtime_error( "unknown pixel format" );
535-
536516
return (bool) _pixFmt->flags & PIX_FMT_PAL;
537517
}
538518

539519
bool VideoProperties::isBitWisePacked() const
540520
{
541521
if( ! _pixFmt )
542522
throw std::runtime_error( "unknown pixel format" );
543-
544523
return (bool) _pixFmt->flags & PIX_FMT_BITSTREAM;
545524
}
546525

547526
bool VideoProperties::isHardwareAccelerated() const
548527
{
549528
if( ! _pixFmt )
550529
throw std::runtime_error( "unknown pixel format" );
551-
552530
return (bool) _pixFmt->flags & PIX_FMT_HWACCEL;
553531
}
554532

555533
bool VideoProperties::isPlanar() const
556534
{
557535
if( ! _pixFmt )
558536
throw std::runtime_error( "unknown pixel format" );
559-
560537
return (bool) _pixFmt->flags & PIX_FMT_PLANAR;
561538
}
562539

563540
bool VideoProperties::isRgbPixelData() const
564541
{
565542
if( ! _pixFmt )
566543
throw std::runtime_error( "unknown pixel format" );
567-
568544
return (bool) _pixFmt->flags & PIX_FMT_RGB;
569545
}
570546

src/AvTranscoder/mediaProperty/VideoProperties.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class AvExport VideoProperties
9999
const AVPixFmtDescriptor& getAVPixFmtDescriptor() { return *_pixFmt; }
100100
#endif
101101

102-
MetadatasMap getDataMap() const; ///< Warning: the method calls analyseGopStructure, which can modify state of the object
102+
MetadatasMap getDataMap() const;
103103

104104
private:
105105
/**

0 commit comments

Comments
 (0)