]> git.sesse.net Git - bmusb/blobdiff - bmusb/bmusb.h
Add some pixel formats for private use.
[bmusb] / bmusb / bmusb.h
index 0ea7c369fb86e04398d41f019617c0e6f8e5eb74..b1861efb6ddf045ae7d6a49a31d2c4667e314a25 100644 (file)
@@ -126,6 +126,7 @@ struct AudioFormat {
        uint16_t id = 0;  // For debugging/logging only.
        unsigned bits_per_sample = 0;
        unsigned num_channels = 0;
+       unsigned sample_rate = 48000;
 };
 
 enum PixelFormat {
@@ -153,9 +154,21 @@ enum PixelFormat {
        // the stride member of VideoFormat.
        PixelFormat_10BitYCbCr,
 
-       // 8-bit 4:4:4:4 RGBA (in that order). bmusb itself doesn't
+       // 8-bit 4:4:4:4 BGRA (in that order). bmusb itself doesn't
        // produce this, but it is useful to represent e.g. synthetic inputs.
-       PixelFormat_8BitRGBA
+       PixelFormat_8BitBGRA,
+
+       // 8-bit 4:2:0, 4:2:2, 4:4:4 or really anything else, planar
+       // (ie., first all Y', then all Cb, then all Cr). bmusb doesn't
+       // produce this, nor does it specify a mechanism to describe
+       // the precise details of the format.
+       PixelFormat_8BitYCbCrPlanar,
+
+       // These exist only so that the type is guaranteed wide enough
+       // to contain values up to 127. CaptureInterface instances
+       // are free to use them as they see fit for private uses.
+       PixelFormat_Unused100 = 100,
+       PixelFormat_Unused127 = 127
 };
 
 typedef std::function<void(uint16_t timecode,