Skip to content

Commit

Permalink
Add Telemetry for video code usage
Browse files Browse the repository at this point in the history
Summary: Add telemetry each time a video codec is instiated, with information about the image format, the encoded pixel format, and whether the codec is SW or HW.

Reviewed By: hanghu

Differential Revision: D67177443

fbshipit-source-id: e90dfb55fdae60e31414b9201832304172e20d8e
  • Loading branch information
Georges Berenger authored and facebook-github-bot committed Dec 13, 2024
1 parent 3054451 commit b490899
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions vrs/RecordFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,17 @@ void ImageContentBlockSpec::clear() {
codecQuality_ = kQualityUndefined;
}

ImageContentBlockSpec ImageContentBlockSpec::core() const {
return {
imageFormat_,
pixelFormat_,
width_,
height_,
stride_ > 0 && stride_ != getDefaultStride() ? stride_ : 0,
stride2_ > 0 && stride2_ != getDefaultStride2() ? stride2_ : 0,
codecName_};
}

bool ImageContentBlockSpec::operator==(const ImageContentBlockSpec& rhs) const {
auto tie = [](const ImageContentBlockSpec& v) {
return std::tie(
Expand Down
6 changes: 5 additions & 1 deletion vrs/RecordFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ class ImageContentBlockSpec {
/// Clear/reset object to default values.
void clear();

/// Convert to string, to store on disk & reconstruct later using factory constructor. @internal
/// Return base of format (no codec quality nor key frame info)
ImageContentBlockSpec core() const;

/// Convert to string, to store on disk & reconstruct later using factory constructor.
/// @internal
string asString() const;

/// Get the number of bytes for this content block, or ContentBlock::kSizeUnknown.
Expand Down

0 comments on commit b490899

Please sign in to comment.