video: add video format

start working on v4l2 source
This commit is contained in:
Wim Taymans 2016-07-05 17:58:34 +02:00
parent 3c029cba53
commit beedb65f00
25 changed files with 1878 additions and 43 deletions

View file

@ -25,6 +25,9 @@ extern "C" {
#endif
#include <spa/format.h>
#include <spa/audio/raw.h>
typedef struct _SpaAudioRawFormat SpaAudioRawFormat;
typedef enum {
SPA_PROP_ID_AUDIO_FORMAT = SPA_PROP_ID_MEDIA_CUSTOM_START,
@ -36,6 +39,16 @@ typedef enum {
SPA_PROP_ID_AUDIO_RAW_INFO,
} SpaPropIdAudio;
struct _SpaAudioRawFormat {
SpaFormat format;
uint32_t unset_mask;
SpaAudioRawInfo info;
};
SpaResult spa_audio_raw_format_init (SpaAudioRawFormat *format);
SpaResult spa_audio_raw_format_parse (const SpaFormat *format,
SpaAudioRawFormat *rawformat);
#ifdef __cplusplus
} /* extern "C" */

View file

@ -25,12 +25,9 @@ extern "C" {
#endif
typedef struct _SpaAudioRawInfo SpaAudioRawInfo;
typedef struct _SpaAudioRawFormat SpaAudioRawFormat;
#include <endian.h>
#include <spa/audio/format.h>
#if __BYTE_ORDER == __BIG_ENDIAN
#define _SPA_AUDIO_FORMAT_NE(fmt) SPA_AUDIO_FORMAT_ ## fmt ## BE
#define _SPA_AUDIO_FORMAT_OE(fmt) SPA_AUDIO_FORMAT_ ## fmt ## LE
@ -141,16 +138,6 @@ struct _SpaAudioRawInfo {
uint32_t channel_mask;
};
struct _SpaAudioRawFormat {
SpaFormat format;
uint32_t unset_mask;
SpaAudioRawInfo info;
};
SpaResult spa_audio_raw_format_init (SpaAudioRawFormat *format);
SpaResult spa_audio_raw_format_parse (const SpaFormat *format,
SpaAudioRawFormat *rawformat);
#ifdef __cplusplus
} /* extern "C" */
#endif