summaryrefslogtreecommitdiff
path: root/src/rtp_profile_amrwb.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtp_profile_amrwb.cc')
-rw-r--r--src/rtp_profile_amrwb.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/rtp_profile_amrwb.cc b/src/rtp_profile_amrwb.cc
index b376cb9..94084cf 100644
--- a/src/rtp_profile_amrwb.cc
+++ b/src/rtp_profile_amrwb.cc
@@ -94,7 +94,7 @@ static int frame_type_index(const char *frame_header)
return (*frame_header >> 3) & 0xf;
}
-static int set_frame_type_index(char *frame_header, int index)
+static void set_frame_type_index(char *frame_header, int index)
{
*frame_header = (*frame_header & 0x87) | ( (index & 0xf) << 3);
}
@@ -105,12 +105,13 @@ static int set_frame_type_index(char *frame_header, int index)
* set the RX_TYPE (see [6]) to either SPEECH_BAD or SID_BAD
* depending on the frame type (FT).
*/
+/*
static int quality_indicator(const char *frame_header)
{
return (*frame_header >> 2) & 0x1;
}
-
-static int set_quality_indicator(char *frame_header, int quality)
+*/
+static void set_quality_indicator(char *frame_header, int quality)
{
*frame_header = (*frame_header & 0xf8) | ( (quality & 0x1) << 2);
}
@@ -223,10 +224,13 @@ int profile_amrwb_unpack(struct lrtp_profile_t *profile,
const RTP &rtp,
std::list<outputframe_t *> &framelist)
{
- struct lrtp_profile_amrwb_t *p = (struct lrtp_profile_amrwb_t *)profile;
+ //struct lrtp_profile_amrwb_t *p = (struct lrtp_profile_amrwb_t *)profile;
- size_t size = rtp.payloadSize();
+ //size_t size = rtp.payloadSize();
const char *payload = rtp.payloadData();
+
+ unsigned int timestamp = rtp.timestamp();
+
/*
printf("---------------------------------------- New packet:\n");
printf("payload (unpack):\n");
@@ -265,6 +269,7 @@ int profile_amrwb_unpack(struct lrtp_profile_t *profile,
size_t frame_size = wb_frame_size[frame_size_idx];
outputframe_t *of = new outputframe_t();
+ of->ts = timestamp;
of->size = frame_size;
char *buf = (char*)malloc(of->size);
memcpy(buf, frame_data, frame_size);
@@ -278,6 +283,9 @@ int profile_amrwb_unpack(struct lrtp_profile_t *profile,
frame_toc += frameheader_size;
frame_data += frame_size;
+ int num_samples = 1; // TODO: Figure out how many samples were in this package
+ timestamp += num_samples;
+
frame_num--;
}