FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
fits.c File Reference
#include "avcodec.h"
#include "libavutil/dict.h"
#include "fits.h"

Go to the source code of this file.

Macros

#define CHECK_KEYWORD(key)
 
#define CHECK_VALUE(key, val)
 

Functions

int avpriv_fits_header_init (FITSHeader *header, FITSHeaderState state)
 Initialize a single header line. More...
 
static int dict_set_if_not_null (AVDictionary ***metadata, char *keyword, char *value)
 
static int read_keyword_value (const uint8_t *ptr8, char *keyword, char *value)
 Extract keyword and value from a header line (80 bytes) and store them in keyword and value strings respectively. More...
 
int avpriv_fits_header_parse_line (void *avcl, FITSHeader *header, const uint8_t line[80], AVDictionary ***metadata)
 Parse a single header line. More...
 

Macro Definition Documentation

#define CHECK_KEYWORD (   key)
Value:
if (strcmp(keyword, key)) { \
av_log(avcl, AV_LOG_ERROR, "expected %s keyword, found %s = %s\n", key, keyword, value); \
}
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
const char * key
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
return
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109

Definition at line 96 of file fits.c.

Referenced by avpriv_fits_header_parse_line().

#define CHECK_VALUE (   key,
  val 
)
Value:
if (sscanf(value, "%d", &header->val) != 1) { \
av_log(avcl, AV_LOG_ERROR, "invalid value of %s keyword, %s = %s\n", key, keyword, value); \
}
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
const char * key
static const uint8_t header[24]
Definition: sdr2.c:67
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
return
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109

Definition at line 102 of file fits.c.

Referenced by avpriv_fits_header_parse_line().

Function Documentation

int avpriv_fits_header_init ( FITSHeader header,
FITSHeaderState  state 
)

Initialize a single header line.

Parameters
headerpointer to the header
statecurrent state of parsing the header
Returns
0 if successful otherwise AVERROR_INVALIDDATA

Definition at line 26 of file fits.c.

Referenced by fits_read_header(), and fits_read_packet().

static int dict_set_if_not_null ( AVDictionary ***  metadata,
char *  keyword,
char *  value 
)
static

Definition at line 43 of file fits.c.

Referenced by avpriv_fits_header_parse_line().

static int read_keyword_value ( const uint8_t ptr8,
char *  keyword,
char *  value 
)
static

Extract keyword and value from a header line (80 bytes) and store them in keyword and value strings respectively.

Parameters
ptr8pointer to the data
keywordpointer to the char array in which keyword is to be stored
valuepointer to the char array in which value is to be stored
Returns
0 if calculated successfully otherwise AVERROR_INVALIDDATA

Definition at line 57 of file fits.c.

Referenced by avpriv_fits_header_parse_line().

int avpriv_fits_header_parse_line ( void avcl,
FITSHeader header,
const uint8_t  line[80],
AVDictionary ***  metadata 
)

Parse a single header line.

Parameters
avclused in av_log
headerpointer to the header
lineone header line
metadataused to store metadata while decoding
Returns
0 if successful otherwise AVERROR_INVALIDDATA

Definition at line 108 of file fits.c.

Referenced by fits_read_header(), and is_image().