void CRtpSendSource::Send(TRtpSendPacket* aPacket, TRequestStatus &aStatus) { __RTP_LOG(_L("CRtpSendSource::Send() ...aStatus ")); __RTP_LOG1(_L("\t[TRtpSendPacket] == %d"), aPacket); __ASSERT_DEBUG(!IsActive(), Panic(ERtpCantSend2PacketsAtOnce)); iLastSentPacket = aPacket; if (iAlignment > 1 && aPacket->Data().Length() % iAlignment) { // We need to pad TInt padding = iAlignment - aPacket->Data().Length() % iAlignment; TInt length = aPacket->Data().Length(); if (aPacket->Data().MaxLength() < length + padding) { TRequestStatus* status = &aStatus; User::RequestComplete(status, KErrGeneral); __RTP_LOG(_L("\tiData.MaxLength() < length + padding\t==> User::RequestComplete(status, KErrGeneral)")); return; } // we need to pad with zeros TChar zeroFill(0); aPacket->Data().AppendFill(zeroFill, padding-1); // and set number of padded octets aPacket->Data().AppendFill(padding, padding); aPacket->Header()->iPadding = 1; // we need to write to the packet directly as well since other header fields // were already copied in RRtpSendPacket::Send() TRtpFixedHdrMemLayout header(aPacket->Data()); header.SetPadding(ETrue); } iSession->Send(aPacket, aStatus); }
bool RGBA32Buffer::setSize(int newWidth, int newHeight) { // NOTE: This has no way to check for allocation failure if the // requested size was too big... m_bytes.resize(newWidth * newHeight); m_size = IntSize(newWidth, newHeight); // Zero the image. zeroFill(); return true; }
bool RGBA32Buffer::setSize(int newWidth, int newHeight) { // This function should only be called once, it will leak memory // otherwise. ASSERT(width() == 0 && height() == 0); m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, newWidth, newHeight); if (!m_bitmap.allocPixels()) return false; // Zero the image. zeroFill(); return true; }
void fill_space( int *type, /* 0 --> zero fill, 1 --> space fill */ int *width ) { /* fill the buffer as requested */ if(*type) blankFill(raw_buffer, *width); else zeroFill(raw_buffer, *width); /* Set size for return */ raw_buffer_used = *width; return; }
bool RGBA32Buffer::setSize(int newWidth, int newHeight) { // This function should only be called once, it will leak memory // otherwise. ASSERT(width() == 0 && height() == 0); m_size = IntSize(newWidth, newHeight); m_image = QImage(); m_pixmap = QPixmap(newWidth, newHeight); if (m_pixmap.isNull()) return false; // Zero the image. zeroFill(); return true; }
bool RGBA32Buffer::setSize(int newWidth, int newHeight) { // This function should only be called once, it will leak memory // otherwise. ASSERT(width() == 0 && height() == 0); m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, newWidth, newHeight); if (!m_bitmap.allocPixels()) { // Allocation failure, maybe the bitmap was too big. setStatus(FrameComplete); return false; } // Zero the image. zeroFill(); return true; }
void fill_namestr( int *isChar, /* Bool: Is this a character varible */ // int *nhfun, /* HASH OF NNAME (always 0) */ int *nlng, /* LENGTH OF VARIABLE IN OBSERVATION */ int *nvar0, /* VARNUM */ char **nname, /* NAME OF VARIABLE */ char **nlabel, /* LABEL OF VARIABLE */ char **nform, /* NAME OF FORMAT */ int *nfl, /* FORMAT FIELD LENGTH OR 0 */ int *nfd, /* FORMAT NUMBER OF DECIMALS */ int *nfj, /* 0=LEFT JUSTIFICATION, 1=RIGHT JUST */ // char nfill[2], /* (UNUSED, FOR ALIGNMENT AND FUTURE) */ char **niform, /* NAME OF INPUT FORMAT */ int *nifl, /* INFORMAT LENGTH ATTRIBUTE */ int *nifd, /* INFORMAT NUMBER OF DECIMALS */ int *npos /* POSITION OF VALUE IN OBSERVATION */ // char rest[52], /* remaining fields are irrelevant */ ) { struct NAMESTR_RECORD namestr_record; namestr_record.ntype = (short) *isChar?2:1; /* VARIABLE TYPE: 1=NUMERIC, 2=CHAR */ namestr_record.nhfun = (short) 0; /* HASH OF NNAME (always 0) */ namestr_record.nlng = (short) *nlng; /* LENGTH OF VARIABLE IN OBSERVATION */ namestr_record.nvar0 = (short) *nvar0; /* VARNUM */ blankCopy(namestr_record.nname, 8, nname[0] ); /* NAME OF VARIABLE */ blankCopy(namestr_record.nlabel, 40, nlabel[0]); /* LABEL OF VARIABLE */ blankCopy(namestr_record.nform, 8, nform[0] ); /* NAME OF FORMAT */ namestr_record.nfl = (short) *nfl; /* FORMAT FIELD LENGTH OR 0 */ namestr_record.nfd = (short) *nfd; /* FORMAT NUMBER OF DECIMALS */ namestr_record.nfj = (short) *nfj; /* 0=LEFT JUSTIFICATION, 1=RIGHT JUST */ zeroFill(namestr_record.nfill, 2); /* (UNUSED, FOR ALIGNMENT AND FUTURE) */ blankCopy(namestr_record.niform, 8, niform[0]); /* NAME OF INPUT FORMAT */ namestr_record.nifl = (short) *nifl; /* INFORMAT LENGTH ATTRIBUTE */ namestr_record.nifd = (short) *nifd; /* INFORMAT NUMBER OF DECIMALS */ namestr_record.npos = (int) *npos; /* POSITION OF VALUE IN OBSERVATION */ zeroFill(namestr_record.rest, 52); /* remaining fields are irrelevant */ TO_BIGEND_SHORT( namestr_record.ntype ); TO_BIGEND_SHORT( namestr_record.nhfun ); TO_BIGEND_SHORT( namestr_record.nlng ); TO_BIGEND_SHORT( namestr_record.nvar0 ); TO_BIGEND_SHORT( namestr_record.nfl ); TO_BIGEND_SHORT( namestr_record.nfd ); TO_BIGEND_SHORT( namestr_record.nfj ); TO_BIGEND_SHORT( namestr_record.nifl ); TO_BIGEND_SHORT( namestr_record.nifd ); TO_BIGEND_INT ( namestr_record.npos ); /* copy filled struct to return area */ memcpy( raw_buffer, &namestr_record, sizeof(namestr_record) ); /* Set size for return */ raw_buffer_used = 140; return; }