Detect and delete a wav header.
int check_wav_post_monitor |
( |
struct check_wav_context * |
cwc | ) |
|
Filter out the wav header, pushdown everything else.
- Parameters
-
cwc | The context of this instance. |
This function looks at the first WAV_HEADER_SIZE
bytes of the input queue of the btrn of cwc. If they look like a wav header, the function extracts the information of interest and swallows this part of the stream. Otherwise it is pushed down to all children. In either case the rest of the input is pushed down as well.
Once the first part has been processed this way, the state of the instance changes from CWS_NEED_HEADER
to CWS_HAVE_HEADER
or CWS_NO_HEADER
.
- Returns
- Standard.
References btr_merge(), btr_next_buffer(), btr_node_status(), BTR_NT_INTERNAL, CWS_HAVE_HEADER, CWS_NEED_HEADER, CWS_NO_HEADER, PARA_INFO_LOG, PARA_NOTICE_LOG, and SAMPLE_FORMATS.
struct check_wav_context* check_wav_init |
( |
struct btr_node * |
parent, |
|
|
struct btr_node * |
child, |
|
|
struct wav_params * |
params, |
|
|
struct btr_node ** |
cw_btrn |
|
) |
| |
Allocate and set up a new check_wav instance.
- Parameters
-
parent | This buffer tree node will be the parent of the new node. |
child | The child of the new node. |
params | Default values and options. |
cw_btrn | A pointer to the check wav node is returned here. |
This function also sets up the ->execute handler of the btrn so that all children of this node can figure out channel count, sample rate, etc.
- Returns
- The (opaque) handle of the newly created check_wav instance. It is supposed to be passed to check_wav_pre_monitor() and check_wav_post_monitor().
- See also
- btr_new_node.
References btr_new_node(), CWS_NEED_HEADER, EMBRACE, WAV_HEADER_LEN, and zalloc().